mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 16:50:58 +01:00
43587: vcs_info git: In 'git rebase -i', when computing subjects of applied-patches, handle an edge case where the subject is not available.
This commit is contained in:
parent
0c00eed4c7
commit
5c9ef1a1fa
2 changed files with 24 additions and 0 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
2018-10-07 Daniel Shahaf <d.s@daniel.shahaf.name>
|
2018-10-07 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||||
|
|
||||||
|
* 43587: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
|
||||||
|
vcs_info git: In 'git rebase -i', when computing subjects
|
||||||
|
of applied-patches, handle an edge case where the subject is
|
||||||
|
not available.
|
||||||
|
|
||||||
* 43588: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
|
* 43588: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
|
||||||
vcs_info git: Make sure applied-patches is of the form "$hash
|
vcs_info git: Make sure applied-patches is of the form "$hash
|
||||||
$subject" --- that is, has a space and a non-empty second
|
$subject" --- that is, has a space and a non-empty second
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,24 @@ elif [[ -d "${gitdir}/rebase-merge" ]]; then
|
||||||
# The line is of the form "pick $hash $subject".
|
# The line is of the form "pick $hash $subject".
|
||||||
# Just strip the verb and we're good to go.
|
# Just strip the verb and we're good to go.
|
||||||
p=${p#* }
|
p=${p#* }
|
||||||
|
# Special case: in an interactive rebase, if the user wrote "p $shorthash\n"
|
||||||
|
# in the editor (without a description after the hash), then the .../done
|
||||||
|
# file will contain "p $longhash $shorthash\n" (git 2.11.0) or "pick $longhash\n"
|
||||||
|
# (git 2.19.0).
|
||||||
|
if [[ $p != *\ * ]]; then
|
||||||
|
# The line is of the form "pick $longhash\n"
|
||||||
|
#
|
||||||
|
# Mark the log message subject as unknown.
|
||||||
|
# TODO: Can we performantly obtain the subject?
|
||||||
|
p+=" ?"
|
||||||
|
elif (( ${#${p//[^ ]}} == 1 )) && [[ ${p%% *} == ${p#* }* ]]; then
|
||||||
|
# The line is of the form "p $longhash $shorthash\n"
|
||||||
|
#
|
||||||
|
# The shorthash is superfluous, so discard it, and mark
|
||||||
|
# the log message subject as unknown.
|
||||||
|
# TODO: Can we performantly obtain the subject?
|
||||||
|
p="${p%% *} ?"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
(x *)
|
(x *)
|
||||||
# The line is of the form 'exec foo bar baz' where 'foo bar
|
# The line is of the form 'exec foo bar baz' where 'foo bar
|
||||||
|
|
@ -212,6 +230,7 @@ elif [[ -d "${gitdir}/rebase-merge" ]]; then
|
||||||
git_patches_applied+=("$p")
|
git_patches_applied+=("$p")
|
||||||
done
|
done
|
||||||
if [[ -f "${patchdir}/git-rebase-todo" ]] ; then
|
if [[ -f "${patchdir}/git-rebase-todo" ]] ; then
|
||||||
|
# TODO: Process ${patchdir}/git-rebase-todo lines like ${patchdir}/done lines are
|
||||||
git_patches_unapplied=( ${${(f)${"$(<"${patchdir}/git-rebase-todo")"}}:#[#]*} )
|
git_patches_unapplied=( ${${(f)${"$(<"${patchdir}/git-rebase-todo")"}}:#[#]*} )
|
||||||
fi
|
fi
|
||||||
VCS_INFO_git_handle_patches
|
VCS_INFO_git_handle_patches
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue