git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: Igor Djordjevic <igor.d.djordjevic@gmail.com>
To: Johannes Sixt <j6t@kdbg.org>, Rafael Ascensao <rafa.almas@gmail.com>
Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>,
	Stefan Beller <sbeller@google.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH/RFC] git-post: the opposite of git-cherry-pick
Date: Tue, 17 Oct 2017 23:15:29 +0200
Message-ID: <dcddb20d-b838-0131-ea31-4ab7186dd088@gmail.com> (raw)
In-Reply-To: <d3ccfb02-004a-bbc3-af33-967db280c940@kdbg.org>

On 17/10/2017 19:30, Johannes Sixt wrote:
> Am 17.10.2017 um 01:01 schrieb Rafael Ascensao:
>>> 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).
>>
>> What if we borrow '--onto' from rebase and make it cherry-pick --onto
>> <destination>?
> 
> I actually like this. Although I would miss the convenience that the 
> source defaults to HEAD. Unless we make a special case for --onto, 
> that is, of course.

I second this.

From my point of view, I would say that "cherry-pick" in general 
seems to just imply "taking" commits (picking "cherries"), where 
direction flow is irrelevant, or at least not strongly implied. For 
me, it`s more "from somewhere else to somebody else", indeed.

The fact that it currently "posts" its picks "to me" (on top of 
current HEAD) could very well be justified/explained as the most 
obvious case (at time of implementation, at least), where usually one 
does work "here" (HEAD), thus cares to have commits picked over 
"here" as well - but it doesn`t have to be a restriction, where other 
destination besides HEAD could/should be allowed.

Anyway, I`d say current behaviour without "--onto" should stay, 
indeed, where HEAD destination is implied if not otherwise specified 
(and that seems to align well with some other Git commands, too). 
Also, in case "--onto" _is_ provided, maybe commit to be picked could 
be allowed to be omitted, defaulting to HEAD again, but as source 
this time.

That said, might be 'git commit' looks like a nice candidate for 
being taught this new trick as well (optionally commit to a revision 
other than HEAD, what Ævar already mentioned), following the same 
logic... ;) It would even be a better (more straightforward) fit for 
one of your previous examples:

> Another use case is when you receive a patch to be applied on a 
> different branch while you are in the middle of some work. If it can be 
> applied on the current branch, then you can post it to the destination, 
> rewind, and continue with your work.

p.s. I`m very interested in this functionality, and more - I have a 
beginner`s attempt in addressing a similar use-case this topic is 
concerned with (symptomatically using a variation of "--onto" as well 
:P), hopefully I`ll sent out something soon, for the sake of 
discussion/opinion, at least :(

Regards,
Buga

      reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 19:13 Johannes Sixt
2017-10-05 19:33 ` Stefan Beller
2017-10-05 21:22   ` Johannes Sixt
2017-10-13 10:51     ` Ævar Arnfjörð Bjarmason
2017-10-15 15:09       ` Johannes Sixt
2017-10-16 23:01         ` Rafael Ascensao
2017-10-17 17:30           ` Johannes Sixt
2017-10-17 21:15             ` Igor Djordjevic [this message]

Reply instructions:

You may reply publically 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dcddb20d-b838-0131-ea31-4ab7186dd088@gmail.com \
    --to=igor.d.djordjevic@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=rafa.almas@gmail.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox