Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] vcs_info git: fix applied patch detection on git am
- X-seq: zsh-workers 33391
- From: Marc Finet <m.dreadlock@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] vcs_info git: fix applied patch detection on git am
- Date: Thu, 9 Oct 2014 00:24:45 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; bh=dQQDyrlyumMT04+z4JdDMFKYov5orbQZuOxXstnaqro=; b=D41N7qmiUpcZst749qd1Tjy7XSBUL7FiggnGeZpmJesH1nR+KUlcLl6NWvnx+jsNN9 oj4fe/NdwR8tBWLWah18XLjwKFinaeMjj/SiFn+QcQyeESJ/yrMmgQzGbUx+9e9paHas 7OuDJgdqMvc/+KEn4cL6bZkBg1k3Yo8dgVzLbD5SmYQIbNqDwdZdUnLB2CI+oBsjlCqu YJ1xt2HrcraGluohnp5CRYEtgEHpQAPfNN2+mTfOn0iYALgSfs5nXcjMbhsKy439n9AB miJrVsvvzpewUE9Z0q8tOX9ytzXE4YBJYY8EaMzAJMBJQELe6ob5TqJYRrBSFHcn0PcT NpXw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
git-am also uses .git/rebase-apply for patch list but
the file original-commit does not exist (as no commit exist).
This patch handles both git rebase and git am. Also:
- get the first line (rather than the first char) when the message
contains only one line;
- remove unused function (ironically that should have been used here).
---
Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index ee50be6..48d552f 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -195,14 +195,6 @@ fi
VCS_INFO_adjust
VCS_INFO_git_getaction ${gitdir}
-
-VCS_INFO_get_get_rebase()
-{
- if [[ -f "$1" ]]; then
- echo "$(< "$1")"
- fi
-}
-
local patchdir=${gitdir}/patches/${gitbranch}
if [[ -d $patchdir ]] && [[ -f $patchdir/applied ]] \
&& [[ -f $patchdir/unapplied ]]
@@ -223,11 +215,16 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
# Fake patch names for all but current patch
patchdir="${gitdir}/rebase-apply"
local cur=$(< "${patchdir}/next")
- local p
+ local p subject
for p in $(seq $(($cur - 1))); do
git_patches_applied+=("$(printf "%04d" $p) ?")
done
- git_patches_applied+=("$(< "${patchdir}/original-commit") ${${(f)$(< "${patchdir}/msg-clean")}[1]}")
+ subject="${$(< "${patchdir}/msg-clean")[(f)1]}"
+ if [[ -f "${patchdir}/original-commit" ]]; then
+ git_patches_applied+=("$(< ${patchdir}/original-commit) $subject")
+ else
+ git_patches_applied+=("? $subject")
+ fi
git_patches_unapplied=($(seq $cur $(< "${patchdir}/last")))
VCS_INFO_git_handle_patches
--
2.1.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author