1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 04:30:24 +02:00

36410: vcs_info git: Present merge heads as patches

This shows, during 'git merge', the revision hashes of the "remote" head
(the one that will become second parent of the commit) in the %m expando.

Review-by: Frank Terbeck
This commit is contained in:
Daniel Shahaf 2015-09-03 09:24:16 +00:00
parent 5445d5f0cc
commit 880579dc1e
3 changed files with 24 additions and 1 deletions

View file

@ -230,6 +230,23 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
fi
git_patches_unapplied=($(seq $cur $(< "${patchdir}/last")))
VCS_INFO_git_handle_patches
elif [[ -f "${gitdir}/MERGE_HEAD" ]]; then
# This is 'git merge --no-commit'
local -a heads=( ${(@f)"$(<"${gitdir}/MERGE_HEAD")"} )
local subject;
IFS='' read -r subject < "${gitdir}/MERGE_MSG"
# $subject is the subject line of the would-be commit
# Maybe we can get the subject lines of MERGE_HEAD's commits cheaply?
local p
for p in $heads[@]; do
git_patches_applied+=("$p $subject")
done
unset p
# Not touching git_patches_unapplied
VCS_INFO_git_handle_patches
else
gitmisc=''