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

Re: [PATCH/RFC] git-post: the opposite of git-cherry-pick

From
Johannes Sixt <j6t@kdbg.org>
Date
Oct 15, 2017, 15:09 UTC
Message-ID
<33f7d379-126d-e27e-7dbf-616f5dfbc98a@kdbg.org>
In-Reply-To
<87wp3zs4la.fsf@evledraar.booking.com>
Am 13.10.2017 um 12:51 schrieb Ævar Arnfjörð Bjarmason:
Show 11 quoted lines
> On Thu, Oct 05 2017, Johannes Sixt jotted:
>> Am 05.10.2017 um 21:33 schrieb Stefan Beller:
>>> * Is it a good design choice to have a different command, just because the
>>>     target branch is [not] checked out?
>>
>> I would not want to make it a sub-mode of cherry-pick, if that is what
>> you mean, because "cherry picking" is about getting something, not
>> giving something away.
> 
> It occurs to me that a better long-term UI design might be to make
> git-{cherry-pick,pick) some sort of submodes for git-commit.

I don't quite agree. To commit an index state that is derived from a worktree state is such a common and important operation that it deserves to be its own command. Adding different modi operandi would make it confusing.

Show 6 quoted lines
> Right now git-commit picks the current index for committing, but "use a
> patch as the source instead" could be a submode.
> 
> Right now it commits that change on top of your checked out commit, but
> "other non-checked-out target commit" could be a mode instead,
> i.e. exposing more of the power of the underlying git-commit-tree.

This is worth discussing, though not my preference. The picture to "pick cherries" has become quite common, and now that we use it for the name of the command, "cherry-pick", the direction of flow is quite obvious and strongly implied: from somewhere else to me (and not to somebody else).

Show 5 quoted lines
> [Not entirely serious]. Well if cherry-picking is taking a thing and
> eating it here, maybe git-cherry-puke takes an already digested thing
> and "throws" it elsewhere ?:)
> 
> It's a silly name but it's somewhat symmetric :)

One of the decisions to be made is whether to begin the new command with "git-cherry-" or not, because it introduces a new abiguity for command line completion.

-- Hannes
Previous: Ævar Arnfjörð BjarmasonNext: Rafael Ascensao
Message 5 of 8 in “git-post: the opposite of git-cherry-pick”
  1. git-post: the opposite of git-cherry-pickJohannes Sixt, Oct 5, 2017
  2. Stefan BellerOct 5, 2017
  3. Johannes SixtOct 5, 2017
  4. Ævar Arnfjörð BjarmasonOct 13, 2017
  5. Johannes SixtOct 15, 2017
  6. Rafael AscensaoOct 16, 2017
  7. Johannes SixtOct 17, 2017
  8. Igor DjordjevicOct 17, 2017

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.