1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

Get subject of current patch in rebase-apply mode

This commit is contained in:
Daniel Hahler 2016-11-20 02:21:39 +01:00
parent 7b7e84f081
commit ccf50048ac
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2016-12-03 Daniel Hahler <zsh@thequod.de>
* 40029: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
Get subject of current patch in rebase-apply mode
2016-12-02 Peter Stephenson <p.w.stephenson@ntlworld.com>
* unposted: Config/version.mk: 5.2-test-1.

View file

@ -236,6 +236,15 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
done
if [[ -f "${patchdir}/msg-clean" ]]; then
subject="${$(< "${patchdir}/msg-clean")[(f)1]}"
elif [[ -f "${patchdir}/${(l:4::0:)cur}" ]]; then
local maxlines=10 line
while IFS= read -r line; do
if [[ "$line" == "Subject:"* ]]; then
subject=${line/(#s)Subject: /}
break
fi
(( --maxlines )) || break
done < "${patchdir}/${(l:4::0:)cur}"
fi
if [[ -f "${patchdir}/original-commit" ]]; then
if [[ -n $subject ]]; then