git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv2 0/9] --left/right-only and --cherry-mark
Date: Thu, 10 Mar 2011 11:48:43 +0100	[thread overview]
Message-ID: <4D78AC8B.7010308@drmicha.warpmail.net> (raw)
In-Reply-To: <7vd3lz5me5.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 10.03.2011 10:56:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> Junio C Hamano venit, vidit, dixit 09.03.2011 22:49:
>> ...
>>> Conceptually revs->cherry_mark ought to be a subset of revs->cherry_pick
>>> and the code shouldn't have to do something like this:
>>>
>>> 	if (revs->cherry_pick || revs->cherry_mark)
>>>         	cherry_pick_list();
>>>
>>> Instead, the code should arrange that revs->cherry_pick is always set
>>> when revs->cherry_mark is set before the calling application enters the
>>> loop to call get_revision().
>>>
>>> But that would make the command line parsing more cumbersome (you would
>>> either waste one bit so that you can tell if you saw --cherry-pick on the
>>> command line, or keep the version of parser in this series as-is, and add
>>> postprocessing code to flip revs->cherry_pick on when revs->cherry_mark
>>> was given in prepare_revision_walk()), and I understand that is why you
>>> did it that way?
>>
>> Yes, I think so :) Another reason is that even cherry_pick_list() needs
>> to know which object flag it should set.
> 
> I didn't have trouble with "if (revs->cherry_mark)" used for that purpose
> at all.
> 
> That is what I meant by "cherry-mark is a _subset_ of cherry-pick".  In
> other words, if you are marking the cherry-pick result, you must be doing
> a cherry-pick to begin with, so having to say "cherry-pick || cherry-mark"
> is a bad taste.
> 
> But that does not contradict with the need to do something differently
> between the case where you are cherry-marking and where you are not
> cherry-marking.
> 
>> - leave the parser as is
>> - set cherry_pick when cherry_mark is set
>> - if (revs->cherry_pick) cherry_pick_list();
>> - leave cherry_pick_list() as is
> 
> I think that essentially is what I speculated in "either X or Y" part as
> solution Y.
> 
>> Would that be better? I didn't do that because it changes the meaning of
>> cherry_pick (it can mean two things then). It would introduce the
>> assumption "pick is set when mark is" instead of "at most one is set"
> 
> Well, as I said earlier, my suggestion was coming from "if you are
> cherry-marking, you must be cherry-picking in the first place", so yes, I
> am saying that "at most one is set" is a bad taste.  If the assumption has
> to change to match the better taste, that can only be a good thing ;-).

Being half-way through doing "Y" I remember why I really disliked "Y":
because it breaks the association between option names (--cherry-pick,
--cherry-mark) and rev flags (cherry_pick, cherry_mark). With "Y",
cherry_pick would mean --cherry-pick or --cherry-mark. (Also, as
mentioned, we're not "picking" when marking.)

Additionally, since parse_revision_opt (which calls handle_revision_opt)
is called from other sites for individual args we would need to do the
handling in the Y case (set pick when marking) right in
handle_revision_opt, not just in setup_revisions. It's a matter of a few
more if's and or's, but still.

Taking these together, I wonder whether we shouldn't leave it as in v2.

Michael

  reply	other threads:[~2011-03-10 10:53 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 12:31 [PATCHv2 0/9] --left/right-only and --cherry-mark Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 1/9] revlist.c: introduce --left/right-only for unsymmetric picking Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 2/9] t6007: Make sure we test --cherry-pick Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 3/9] rev-list: documentation and test for --left/right-only Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 4/9] rev-list: --left/right-only are mutually exclusive Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 5/9] rev-list/log: factor out revision mark generation Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 6/9] revision.c: introduce --cherry-mark Michael J Gruber
2011-03-09 21:29   ` Junio C Hamano
2011-03-10  8:23     ` [PATCHv2+ " Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 7/9] rev-list: documentation and test for --cherry-mark Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 8/9] log --cherry: a synonym Michael J Gruber
2011-03-07 12:31 ` [PATCHv2 9/9] t6007: test rev-list --cherry Michael J Gruber
2011-03-09 21:49 ` [PATCHv2 0/9] --left/right-only and --cherry-mark Junio C Hamano
2011-03-10  8:08   ` Michael J Gruber
2011-03-10  9:56     ` Junio C Hamano
2011-03-10 10:48       ` Michael J Gruber [this message]
2011-03-10 14:44         ` [PATCHv3 00/10] " Michael J Gruber
2011-03-10 14:44           ` [PATCHv3 01/10] revlist.c: introduce --left/right-only for unsymmetric picking Michael J Gruber
2011-03-10 14:44           ` [PATCHv3 02/10] t6007: Make sure we test --cherry-pick Michael J Gruber
2011-03-10 14:44           ` [PATCHv3 03/10] rev-list: documentation and test for --left/right-only Michael J Gruber
2011-03-10 14:44           ` [PATCHv3 04/10] rev-list: --left/right-only are mutually exclusive Michael J Gruber
2011-03-10 14:44           ` [PATCHv3 05/10] rev-list/log: factor out revision mark generation Michael J Gruber
2011-03-10 14:44           ` [PATCHv3 06/10] revision.c: introduce --cherry-mark Michael J Gruber
2011-03-10 14:45           ` [PATCHv3 07/10] rev-list: documentation and test for --cherry-mark Michael J Gruber
2011-03-10 14:45           ` [PATCHv3 08/10] log --cherry: a synonym Michael J Gruber
2011-03-10 14:45           ` [PATCHv3 09/10] t6007: test rev-list --cherry Michael J Gruber
2011-03-10 14:45           ` [PATCHv3 10/10] git-log: put space after commit mark Michael J Gruber
2011-03-10 18:22         ` [PATCHv2 0/9] --left/right-only and --cherry-mark Junio C Hamano
2011-03-11  7:52           ` Michael J Gruber
2011-03-11  8:02             ` Junio C Hamano

Reply instructions:

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

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

  git send-email \
    --in-reply-to=4D78AC8B.7010308@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).