[StGIT PATCH 1/4] Fix stg-whatchanged to deal with conflicts already solved.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Yann Dirson <yann.dirson@xxxxxxxxx>

The most reliable way I found to decide if we were in the process of
solving a conflict, including when all conflicted files have already
been marked resolved, is to check the latest patchlog entry.

Signed-off-by: Yann Dirson <ydirson@xxxxxxxxxx>
---

 contrib/stg-whatchanged |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/contrib/stg-whatchanged b/contrib/stg-whatchanged
index a416e97..231f4f5 100755
--- a/contrib/stg-whatchanged
+++ b/contrib/stg-whatchanged
@@ -24,12 +24,10 @@ fi
 # Merges via "push" leave top=bottom so we must look at old patch
 # in this case (unlike, eg., "pick --fold")
 patchdir="$(git-rev-parse --git-dir)/patches/$(stg branch)/patches/$(stg top)"
-if [ -s "$(git-rev-parse --git-dir)/conflicts" ];
-then
-    current_cmd="stg show //top.old"
-else
-    current_cmd="stg show"
-fi
+case $(stg log | head -n1) in
+    *push\(c\)*) current_cmd="stg show //top.old" ;;
+    *) current_cmd="stg show" ;;
+esac
 
 colordiff "$@" \
     -I '^index [0-9a-b]*..[0-9a-b]*' \

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux