From a27fad1ae2c87bdb4861005719fd7db86827344c Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 2 Oct 2018 15:20:52 +0000 Subject: 43586: vcs_info git: Reformat to minimise next diff. No functional change. --- ChangeLog | 4 ++++ Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 936b76a6f..0191b3164 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2018-10-07 Daniel Shahaf + * 43586: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + vcs_info git: Reformat to minimise next diff. No functional + change. + * 43585: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn: vcs_info svn: Recognize working copies in need of an upgrade. diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index 05de4ae84..892b4741f 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -191,8 +191,19 @@ elif [[ -d "${gitdir}/rebase-merge" ]]; then # pick/edit/fixup/squash/reword: Add "$hash $subject" to $git_patches_applied. # exec: Add "exec ${command}" to $git_patches_applied. # (anything else): As 'exec'. - p=${p/(#s)(p|pick|e|edit|r|reword|f|fixup|s|squash) /} - p=${p/(#s)x /exec } + case $p in + ((p|pick|e|edit|r|reword|f|fixup|s|squash)' '*) + # The line is of the form "pick $hash $subject". + # Just strip the verb and we're good to go. + p=${p#* } + ;; + (x *) + # The line is of the form 'exec foo bar baz' where 'foo bar + # baz' is a shell command. There's no way to map _that_ to + # "$hash $subject", but I hope this counts as making an effort. + p=${p/x /exec } + ;; + esac git_patches_applied+=("$p") done if [[ -f "${patchdir}/git-rebase-todo" ]] ; then -- cgit 1.4.1