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

Re: [PATCH 2/2] learn to pick/revert into unborn branch

From
Philip Oakley <philipoakley@iee.org>
Date
Dec 23, 2012, 20:21 UTC
Message-ID
<F74DFEF2E8914E76BDA501CA5CD4605F@PhilipOakley>
In-Reply-To
<7vzk14o9sk.fsf@alter.siamese.dyndns.org>
From: "Junio C Hamano" <gitster@pobox.com> Sent: Sunday, December 23,
2012 3:24 AM
Subject: Re: [PATCH 2/2] learn to pick/revert into unborn branch
Show 19 quoted lines
> Martin von Zweigbergk <martinvonz@gmail.com> writes:
>
>>>From the user's point of view, it seems natural to think that
>> cherry-picking into an unborn branch should work, so make it work,
>> with or without --ff.
>
> I actually am having a hard time imagining how that could ever be
> natural.
>
> When you are on an unborn branch, you may have some files in your
> working tree, and some of them may even be registered to the index,
> but the index is merely for your convenience to create your first
> commit, and as far as the history is concered, it does not matter.
>
> By definition you do not have any history in such a state.  What
> does it even mean to "cherry-pick" another commit, especially
> without the --no-commit option?  The resulting commit will carry the
> message taken from the original commit, but does what it says match
> what you have done?
From: "Junio C Hamano"  Sent: Sunday, December 23, 2012 7:20 PM
Subject: Re: [PATCH 2/2] learn to pick/revert into unborn branch
Show 9 quoted lines
> Christian Couder <christian.couder@gmail.com> writes:
>
>> I agree that it would be nice if it worked.
>
> That is not saying anything.
>
> Yes, it would be nice if everything worked.  But the question in the
> thread is "with what definition of 'work'?"
> --
>From the dumb user perspective, I would have thought that the first

commit to be cherry picked for an unborn branch would be the complete commit, which is then planted as the branch's start commit. We tend to talk of cherry picking commits, though the documentation does say 'the changes introduced', which allows such a (mistaken) user perspective for this particular case.

It is only in retrospect, and a bit of extra thought, that one could see that the commit's message would not actually describe the new situation and should have been edited.

That doesn't mean that it would be right to allow such an initilisation of an unborn branch, it's more an explanation of how the idea may have developed.

Philip
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 11 in “tests: move test_cmp_rev to test-lib-functions”
  1. 1/2 tests: move test_cmp_rev to test-lib-functionsMartin von Zweigbergk, Dec 21, 2012
  2. 2/2 learn to pick/revert into unborn branchMartin von Zweigbergk, Dec 21, 2012
  3. Junio C HamanoDec 23, 2012
  4. Martin von ZweigbergkDec 23, 2012
  5. Christian CouderDec 23, 2012
  6. Junio C HamanoDec 23, 2012
  7. Philip OakleyDec 23, 2012
  8. Junio C HamanoDec 23, 2012
  9. Junio C HamanoDec 23, 2012
  10. Martin von ZweigbergkDec 24, 2012
  11. Junio C HamanoDec 23, 2012

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.