Skip to contentSkip to conversation

git-cherry should show "+" instead of "-" and vice versa

PATCH In review Andy Parkins 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-cherry should show "+" instead of "-" and vice versa

In git-cherry.sh:

if test -f "$patch/$2"
then

    sign=-
  else
    sign=+

fi

Documentation says 'If the change seems to be in the upstream, it is shown on the standard output with prefix "+"', however the above does the reverse. When
the file $patch/$2 exists it is because the patch /is/ in upstream so the sign should be "+".

---
 git-cherry.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
git-cherry.sh +2 -2
index 8832573..1cc48e8 100755
@@ -71,9 +71,9 @@ do
 	then
 		if test -f "$patch/$2"
 		then
-			sign=-
-		else
 			sign=+
+		else
+			sign=-
 		fi
 		case "$verbose" in
 		t)
Signature · 1 line
1.4.2.3
#1 lore raw

Dear diary, on Mon, Oct 23, 2006 at 09:03:08PM CEST, I got a letter where Andy Parkins <[email protected]> said that...

Quoted 7 lines

In git-cherry.sh:

if test -f "$patch/$2"
then

    sign=-
  else
    sign=+
Quoted 8 lines

fi

Documentation says 'If the change seems to be in the upstream, it is shown on the standard output with prefix "+"', however the above does the reverse. When
the file $patch/$2 exists it is because the patch /is/ in upstream so the sign should be "+".

See also

	http://news.gmane.org/find-root.php?message_id=<[email protected]>

Did the documentation ever get fixed or noone cared enough? ;-)

Signature · 5 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)
#2 lore raw
Quoted 1 line · Petr Baudis

Did the documentation ever get fixed or noone cared enough? ;-)

My patch makes git-cherry match the documentation.

Personally I think that the documentation is correct. git-cherry is, to me, terribly useful. I've got a few patches in my own branch and it's very useful to be able to check to see if those emailed patches have been accepted upstream with a simple

git-cherry -v upstream

Which makes it natural to see
"-" = patch not in upstream
"+" = patch in upstream

I read the thread you pointed at, and didn't really understand what the downer on git-cherry was, or why the patch wasn't accepted. Have I misunderstood something?

Andy

Signature · 2 lines
Dr Andrew Parkins, M Eng (Hons), AMIEE
[email protected]