Do show the top-level working dir.
[git-shortcuts.git] / git-heads-for-merge
blob95de2c0cf4cc2a033bf6490f86601280cfa1cd26
1 #!/bin/sh
3 # (Extracted from git-pull.sh; thanks to Junio C Hamano for the direction.)
4 #
5 # Prints out the fetched heads intended for being merged
6 # (which are stored in FETCH_HEAD).
8 # This script makes inspecting the potential merge and
9 # then manually doing it each a simpler command:
11 # git log $(git heads-for-merge) --not HEAD
12 # git merge $(git heads-for-merge)
14 # Or for commits without a common ancestor:
16 # for h in $(git heads-for-merge); do git merge "$h"; done
18 # This sequence of commands is an analog of "Fun with FETCH_HEAD"
19 # (http://) for the case of many fetched heads.
21 # To set up GIT_DIR:
22 . git-sh-setup
24 sed -e '/ not-for-merge /d' \
25 -e 's/ .*//' "$GIT_DIR"/FETCH_HEAD | \
26 tr '\012' ' '