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

Re: cherry-pick --since ?

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Apr 23, 2007, 17:52 UTC
Message-ID
<Pine.LNX.4.64.0704231208490.4667@torch.nrlssc.navy.mil>
In-Reply-To
<7v647qy7dn.fsf@assigned-by-dhcp.cox.net>
On Fri, 20 Apr 2007, Junio C Hamano wrote:
Show 21 quoted lines
> Brandon Casey <casey@nrlssc.navy.mil> writes:
>
>> Is there functionality to allow something akin to
>> a
>>    git cherry-pick --since <commit>
>>
>> or maybe syntax similar to git cherry where the upstream, head,
>> and limit can be specified. Or the .. syntax would work.
>>
>>
>> Here's my use case:
>>
>> Two branches, 'A' and 'B'.
>> 'A' is the master branch.
>> 'B' was forked some time ago and is in bug fix only mode.
>> Much of 'A' and 'B' are still the same, but there have been
>>   some intrusive changes made to 'A' that should not go into 'B'.
>
> You forgot to say "My objective is to make sure all the good
> fixes in B are forward ported to A" but I am assuming that is
> the case.

Yes, that is the case, but the flow is both ways. Other developers may implement fixes in 'A', which must be backported to 'B'. They don't care about 'B'.

Show 6 quoted lines
>>   This is also why I can't just pull from 'B'. rebase may work,
>>   but then of course all of the commit id's change.
>
> I do not understand why you cannot merge 'B' into 'A'.  From the
> commit ancestry perspective, merging is exactly the right thing
> to do if your goal is to forward port all fixes in B to A.

I thought I recalled having problems with a different tree and a similar situation, where a merge did not do what I expected. I'll have to take a look at that one again and post a scenario if I find one.

I just tried a pull from 'B' into 'A' with this tree, and it worked. The need to cherry-pick from 'A' into 'B' still exists though. The work around using format-patch that Alex suggested does work. Being able to cherry-pick a range in a more direct way seems like it would be useful though.

-brandon
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 12 in “cherry-pick --since ?”
  1. Brandon CaseyApr 20, 2007
  2. Alex RiesenApr 20, 2007
  3. David KågedalApr 22, 2007
  4. Junio C HamanoApr 20, 2007
  5. Brandon CaseyApr 23, 2007
  6. Junio C HamanoApr 23, 2007
  7. Brandon CaseyApr 23, 2007
  8. Git range merge (cherry-pick a range)bshOriginal, Jul 16, 2009
  9. Michael J GruberJul 16, 2009
  10. Daniel BarkalowJul 16, 2009
  11. bshOriginalJul 17, 2009
  12. Michael J GruberJul 16, 2009

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.