From: Andrew Pimlott <andrew@pimlott•net>
To: git <git@vger•kernel.org>
Subject: git cherry not marking commits with equivalent upstream
Date: Thu, 01 Jul 2010 12:38:45 -0700 [thread overview]
Message-ID: <1278012954-sup-3724@pimlott.net> (raw)
The documentation for git-cherry says it marks changes in the current
checkout that have an "equivalent" change in the upstream branch. It
even says it's useful when feeding patches upstream by email instead of
git, which is what I'm doing (with CVS instead of email). But it
doesn't seem to work for me.
I'll simulate cloning an upstream repo, creating and commiting a patch,
then sending it via email upstream to have it applied there, then
pulling the upstream commit (the upstream repo is a, mine is b):
~% mkdir a && cd a
~/a% git init
Initialized empty Git repository in /home/andrew/a/.git/
~/a% touch a
~/a% git add a
~/a% git commit -m 1
[master (root-commit) be4fa74] 1
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a
~/a% git clone . ../b && cd ../b
Initialized empty Git repository in /home/andrew/b/.git/
~/b% echo test > a
~/b% git add a
~/b% git commit -m 2
[master 551e90a] 2
1 files changed, 1 insertions(+), 0 deletions(-)
~/b% cd ../a
~/a% echo test > a
~/a% git add a
~/a% git commit -m 3
[master bb13e6c] 3
1 files changed, 1 insertions(+), 0 deletions(-)
~/a% cd ../b
~/b% git pull
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/andrew/a/.
be4fa74..bb13e6c master -> origin/master
Merge made by recursive.
~/b% cat a
test
Now, I think I have two equivalent commits in repo b, one of which came
from repo a (upstream). So I expect git-cherry to show the other commit
with a '-' instead of a '+'. But no:
~/b% git log
commit 27158bb3e5f7cf80a43eb7364a735f16c43e447c
Merge: 551e90a bb13e6c
Author: Andrew Pimlott <andrew@pimlott•net>
Date: Thu Jul 1 12:25:21 2010 -0700
Merge branch 'master' of /home/andrew/a/.
commit bb13e6cea3a27a4450984b6d1d87f13d807d2d36
Author: Andrew Pimlott <andrew@pimlott•net>
Date: Thu Jul 1 12:25:18 2010 -0700
3
commit 551e90ac390a2a27152661b9cbe73845d237e008
Author: Andrew Pimlott <andrew@pimlott•net>
Date: Thu Jul 1 12:25:06 2010 -0700
2
commit be4fa741476176181947e96c5242003ffe4f4183
Author: Andrew Pimlott <andrew@pimlott•net>
Date: Thu Jul 1 12:24:42 2010 -0700
1
~/b% git show bb13e6cea3a27a4450984b6d1d87f13d807d2d36 | git patch-id
58105e2bbccf2799f480bf82bb76467ff0301c52 bb13e6cea3a27a4450984b6d1d87f13d807d2d36
~/b% git show 551e90ac390a2a27152661b9cbe73845d237e008 | git patch-id
58105e2bbccf2799f480bf82bb76467ff0301c52 551e90ac390a2a27152661b9cbe73845d237e008
~/b% git cherry
+ 551e90ac390a2a27152661b9cbe73845d237e008
Is my undestanding of how this should work wrong? Is there any way to get
the result I want?
Andrew
(Please Cc me on replies)
next reply other threads:[~2010-07-01 20:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-01 19:38 Andrew Pimlott [this message]
2010-07-01 19:40 ` git cherry not marking commits with equivalent upstream Andrew Pimlott
2010-07-01 20:41 ` Björn Steinbrink
2010-07-01 21:17 ` Andrew Pimlott
2010-07-01 21:09 ` [PATCH] Documentation: 'cherry' does not cope well with merges from upstream Jonathan Nieder
2010-07-01 21:33 ` Andrew Pimlott
2010-07-01 21:35 ` Jonathan Nieder
2010-07-01 23:52 ` Junio C Hamano
2010-07-02 0:51 ` Jonathan Nieder
2010-07-02 1:04 ` Jonathan Nieder
2010-07-02 7:46 ` Michael J Gruber
2010-07-02 8:18 ` Jonathan Nieder
2010-07-02 9:23 ` Michael J Gruber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1278012954-sup-3724@pimlott.net \
--to=andrew@pimlott$(echo .)net \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox