From: Junio C Hamano Date: Sat, 11 Jan 2014 00:20:39 GMT Subject: Re: [PATCH v2 3/4] merge: make prepare_to_commit responsible for write_merge_state Message-ID: In-Reply-To: <1389228344-38813-4-git-send-email-ryan@yaauie.com> Ryan Biesemeyer writes: > + write_script "$HOOK" <<-EOF && > + if [ -s "$(git rev-parse --git-dir)/MERGE_HEAD" ]; then > + exit 0 > + else > + exit 1 > + fi > + EOF The script can be a one-liner write_scirpt "$HOOK" <<-\EOF && test -s "$(git rev-parse --git-dir)/MERGE_HEAD" EOF can't it? I also do not think you want to have the rev-parse run while writing the script (rather, you would want it run inside the script, no?) > + git merge other && > + test "`git log -1 --pretty=format:%s`" = "Merge branch '"'"'other'"'"'" && > + test ! -s "$(git rev-parse --git-dir)/MERGE_HEAD" > + > +' > + > test_done