git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git cherry improvements suggestions

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 23, 2011, 10:46 UTC
Message-ID
<4D89CF8E.4070100@drmicha.warpmail.net>
In-Reply-To
<AANLkTimk0bkOGVy2W+XddHRuf-1xw+d0RwzPhnk40vi8@mail.gmail.com>
Piotr Krukowiecki venit, vidit, dixit 23.03.2011 09:11:
Show 5 quoted lines
> Hi,
> 
> Short version:
> 
> 1. The <limit> is misleading IMO
In what way? Is the documentation wrong?
Show 5 quoted lines
> 2. Please extend the output to show "full diff"
> 3. Please add numerical/time <limit>
> 4. Would it be possible to use "=" for "equivalent change"?
> 
> Please tell me your opinions.

You will be a happy user of "git log --cherry A...B" instead of "git cherry A B". It gives you all the log option (e.g. p for diff) that you like and uses "=" rather than "-". It's currently in next and will be in the next release.

Show 20 quoted lines
> 
> 
> Long version:
> 
> I have a branch that have diverged long time ago from main branch. I can't use
> merge, so I'm using cherry-pick to transplant changes between branches
> (the other reason is I'm using git-svn...)
> 
> I noticed I did not transplant a certain commit recently. I wanted to
> see if there
> are any other commits I didn't transplant. I tried using git cherry:
> 
> 
> 1. man page says: git cherry [-v] [<upstream> [<head> [<limit>]]]
> 
>    $ git cherry -v master 9_1 20
>    fatal: Unknown commit 20
> 
> After reading man page I though the limit is a numeric limit, like "check
> last 20 commits".
It clearly is the name of a commit in that picture.
Show 12 quoted lines
> 
> 2. The cherry currently shows only changes against one branch:
> 
>    Every commit that doesn’t exist in the <upstream> branch has its id (sha1)
>    reported[...] The ones that have equivalent change already in the <upstream>
>    branch are prefixed with a minus (-) sign, and those that only exist in the
>    <head> branch are prefixed with a plus (+)  symbol
> 
> So it will not show commits that exist only in <upstream> but not in <head>.
> 
> In my case changes are transplanted both ways (in general), so I have to check
> both branches.
You'll be a happy user of "git log --cherry-mark --left-right A...B" :)
> 3. I think a numerical limit (or even: time limit etc) of checked commits would
> be useful, especially in "full diff" mode. Without it would be not

log has a limit argument (-<number>), though I'm not sure it is exactly what you want.

Show 9 quoted lines
> 4. The output format uses "-" to show commits that exist in both branches.
> I find this unnatural. There probably is a reason for this? But maybe it would
> be possible to change the symbols? For example:
> 
>    - commit in upstream only
>    + commit in head only
>    = equivalent commit
> 
> Or "<", ">", " " or any other graphic symbol.

git log --cherry-mark --left-right will use <,=,> git log --cherry-mark or --cherry will use *,=

(And yes, you can use it with --graph!)

Cheers, Michael

Previous: Piotr KrukowieckiNext: Piotr Krukowiecki
Message 2 of 9 in “git cherry improvements suggestions”
  1. Piotr KrukowieckiMar 23, 2011
  2. Michael J GruberMar 23, 2011
  3. Piotr KrukowieckiMar 23, 2011
  4. Michael J GruberMar 23, 2011
  5. Piotr KrukowieckiMar 23, 2011
  6. Michael J GruberMar 23, 2011
  7. Piotr KrukowieckiMar 23, 2011
  8. Piotr KrukowieckiMar 24, 2011
  9. Michael J GruberMar 24, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.