gittips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gittips [2021/09/09 17:39] – Committing with delta PiotrSmyrakgittips [2023/03/13 14:24] (current) – Add a helper script for creating worktree for ports quarterly branch LiWenHsu
Line 25: Line 25:
         pretty = fuller         pretty = fuller
 </code> </code>
 +
 +==== dealing with pgp keys ====
 +
 +When updating pgp keys in the handbook, it's helpful to be able to confirm what actually changed to your key before committing.
 +
 +Consider adding this stanza to your $HOME/.gitconfig:
 +
 +<code>
 +[diff "gpg"]
 + textconv = "f(){ gpg --list-packets < \"$1\" | grep -v \"^# off=\"; }; f"
 +</code>
 +
 +and this to /path/to/your/doc-repo-clone/.git/info/attributes:
 +
 +<code>
 +*.key diff=gpg
 +</code>
 +
 +When you now "git diff" or "git show" in the doc repo, the base64 encoded blobs will be decoded to (slightly) more readable PGP packets.
  
 ==== rewriting history ==== ==== rewriting history ====
Line 64: Line 83:
 cd freebsd-ports; git worktree add -b 2021Q3 ../freebsd-ports-2021Q3 freebsd/2021Q3 cd freebsd-ports; git worktree add -b 2021Q3 ../freebsd-ports-2021Q3 freebsd/2021Q3
 cd freebsd-src; git worktree add -b stable/13 ../freebsd-src-13 freebsd/stable/13 cd freebsd-src; git worktree add -b stable/13 ../freebsd-src-13 freebsd/stable/13
 +</code>
 +
 +=== Helper Scripts ===
 +ports
 +
 +<code>
 +#!/bin/sh
 +
 +year=$(date +"%Y")
 +month=$(date +"%m")
 +quarter=$(((month-1)/3+1))
 +
 +branch="${year}Q${quarter}"
 +
 +git worktree add -b ${branch} ../freebsd-ports-${branch} freebsd/${branch}
 </code> </code>
  
  • gittips.1631209194.txt.gz
  • Last modified: 2021/09/09 17:39
  • by PiotrSmyrak