Junio C Hamano <gitster@xxxxxxxxx> writes: > get_signoff () { > git cat-file commit "$1" | sed -n -e '/^Signed-off-by: /p' > } > > Some may say "cat-file can fail, and having it on the LHS of a pipe > hides its failure", advocating for something like: > > get_signoff () { > git cat-file commit "$1" >sign-off-temp && > sed -n -e '/^Signed-off-by: /p' sign-off-temp > } Actually we should use git itself for things like this, e.g. git -C dst show -s --pretty='format:%(trailers)' HEAD >actual && test_cmp expect actual