git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Jacob Keller <jacob.keller@gmail.com>
Subject: Re: [PATCH 4/5] revision.c: refactor ref selection handler after --exclude
Date: Thu, 26 Jan 2017 09:24:24 -0500	[thread overview]
Message-ID: <20170126142423.6rrorahyzfo6z43q@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8ATM_kc5SPY0dqprUefRy3vtpKW-4QEyJFK54jw0QgeJA@mail.gmail.com>

On Thu, Jan 26, 2017 at 04:28:17PM +0700, Duy Nguyen wrote:

> On Thu, Jan 26, 2017 at 3:57 AM, Jeff King <peff@peff.net> wrote:
> > I don't think it means either. It means to include remotes in the
> > selected revisions, but excluding the entries mentioned by --exclude.
> >
> > IOW:
> >
> >   --exclude=foo --remotes
> >         include all remotes except refs/remotes/foo
> >
> >   --exclude=foo --unrelated --remotes
> >         same
> >
> >   --exclude=foo --decorate-reflog --remotes
> >         decorate reflogs of all remotes except "foo". Do _not_ use them
> >         as traversal tips.
> >
> >   --decorate-reflog --exclude=foo --remotes
> >         same
> >
> > IOW, the ref-selector options build up until a group option is given,
> > which acts on the built-up options (over that group) and then resets the
> > built-up options. Doing "--unrelated" as above is orthogonal (though I
> > think in practice nobody would do that, because it's hard to read).
> 
> This is because it makes sense to combine --exclude and
> --decorate-reflog. But what about a new --something that conflicts
> with either --exclude or --decorate-reflog? Should we simply catch
> such combinations and error out (which may be a bit more complicated
> than this patch, or maybe not)?

I'd cross that bridge when we see what the option is. But my gut is that
rules would be:

  - apply all non-conflicting relevant options. So:

      --exclude=foo/* --decorate-refs --decorate-reflog --remotes

    would presumably decorate both ref tips _and_ reflogs for all
    remotes (except ones in refs/remotes/foo/*)

  - for ones that are directly related and override each other,
    use the usual last-one-wins rule. So:

      --decorate-reflog --no-decorate-reflog --remotes

    would countermand the original --decorate-reflog.

  - for ones that really have complex interactions, notice and complain
    in handle_refs().

That just seems to me like it follows our usual option parsing
procedure. The only difference here is that process and reset some
subset of the flags when we hit a special marker option ("--remotes" in
these examples) instead of doing it at the end.

-Peff

  reply	other threads:[~2017-01-26 14:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 12:26 [PATCH] log: new option decorate reflog of remote refs Nguyễn Thái Ngọc Duy
2017-01-19 17:23 ` Jeff King
2017-01-20 10:55   ` Duy Nguyen
2017-01-20 14:30     ` Jeff King
2017-01-20 22:00       ` Jacob Keller
2017-01-21 12:48         ` Duy Nguyen
2017-01-21 14:08           ` Jeff King
2017-01-25 12:50             ` [PATCH 0/5] Prep steps for --decorate-reflog Nguyễn Thái Ngọc Duy
2017-01-25 12:50               ` [PATCH 1/5] rev-list-options.txt: delete an empty line Nguyễn Thái Ngọc Duy
2017-01-25 12:50               ` [PATCH 2/5] revision.c: group ref selection options together Nguyễn Thái Ngọc Duy
2017-01-25 20:50                 ` Jeff King
2017-01-26  9:18                   ` Duy Nguyen
2017-01-26 14:19                     ` Jeff King
2017-01-25 21:11                 ` Junio C Hamano
2017-01-26  9:12                   ` Duy Nguyen
2017-01-25 12:50               ` [PATCH 3/5] revision.c: allow to change pseudo opt parsing function Nguyễn Thái Ngọc Duy
2017-01-25 12:50               ` [PATCH 4/5] revision.c: refactor ref selection handler after --exclude Nguyễn Thái Ngọc Duy
2017-01-25 17:41                 ` Jacob Keller
2017-01-25 20:57                 ` Jeff King
2017-01-25 21:27                   ` Jeff King
2017-01-25 21:30                     ` Jacob Keller
2017-01-25 23:25                       ` Junio C Hamano
2017-01-26  9:28                   ` Duy Nguyen
2017-01-26 14:24                     ` Jeff King [this message]
2017-01-26 18:43                     ` Junio C Hamano
2017-01-25 21:15                 ` Junio C Hamano
2017-01-25 12:50               ` [PATCH 5/5] revision.c: add --decorate-reflog Nguyễn Thái Ngọc Duy

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

  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=20170126142423.6rrorahyzfo6z43q@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=pclouds@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).