All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emily Shaffer <emilyshaffer@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH v3] rev-list: teach --no-object-names to enable piping
Date: Tue, 18 Jun 2019 15:08:37 -0700	[thread overview]
Message-ID: <20190618220837.GE100487@google.com> (raw)
In-Reply-To: <xmqqk1djsv0d.fsf@gitster-ct.c.googlers.com>

On Mon, Jun 17, 2019 at 03:32:34PM -0700, Junio C Hamano wrote:
> Emily Shaffer <emilyshaffer@google.com> writes:
> 
> > Allow easier parsing by cat-file by giving rev-list an option to print
> > only the OID of a non-commit object without any additional information.
> > This is a short-term shim; later on, rev-list should be taught how to
> > print the types of objects it finds in a format similar to cat-file's.
> >
> > Before this commit, the output from rev-list needed to be massaged
> > before being piped to cat-file, like so:
> >
> >   git rev-list --objects HEAD | cut -f 1 -d ' ' \
> >     | git cat-file --batch-check
> 
> Write this with '|' at the end of the first line; that way the shell
> knows you haven't finished your sentence without any backslash.

Oh cool. Will do.

> 
> > diff --git a/builtin/rev-list.c b/builtin/rev-list.c
> > index 660172b014..7e2598fd22 100644
> > --- a/builtin/rev-list.c
> > +++ b/builtin/rev-list.c
> > @@ -49,6 +49,7 @@ static const char rev_list_usage[] =
> >  "    --objects | --objects-edge\n"
> >  "    --unpacked\n"
> >  "    --header | --pretty\n"
> > +"    --no-object-names\n"
> 
> Ideally, this should be "--[no-]object-names", i.e. --object-names
> which may be the default when using --objects could be tweaked with
> --no-object-names and then again turned on with a --object-names
> later on the command line, following the usual "last one wins".

Sure, good point. Will fix.

> 
> > @@ -75,6 +76,9 @@ enum missing_action {
> >  };
> >  static enum missing_action arg_missing_action;
> >  
> > +/* display only the oid of each object encountered */
> > +static int arg_no_object_names;
> 
> And this would become
> 
>     static int show_object_names = 1;
> 
> that can be turned off via --no-object-names (and --object-names
> would flip it on).  It would reduce the double negation brain
> twister, hopefully.
> 

I'll send a new patch today. Thanks.

 - Emily

  reply	other threads:[~2019-06-18 22:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07 22:59 [PATCH] revision: remove stray whitespace when name empty Emily Shaffer
2019-06-08  0:42 ` Eric Sunshine
2019-06-12 19:23   ` Emily Shaffer
2019-06-09 13:00 ` Jeff King
2019-06-10 16:29   ` Junio C Hamano
2019-06-12 19:37     ` Emily Shaffer
2019-06-13 15:20       ` Jeff King
2019-06-13 21:51 ` [PATCH v2] rev-list: teach --oid-only to enable piping Emily Shaffer
2019-06-14 16:07   ` Jeff King
2019-06-14 20:25     ` Junio C Hamano
2019-06-14 23:18       ` Emily Shaffer
2019-06-14 23:29     ` Emily Shaffer
2019-06-19 21:24       ` Jeff King
2019-06-14 23:48   ` [PATCH v3] rev-list: teach --no-object-names " Emily Shaffer
2019-06-17 22:32     ` Junio C Hamano
2019-06-18 22:08       ` Emily Shaffer [this message]
2019-06-18 22:29     ` [PATCH v4] " Emily Shaffer
2019-06-19 14:08       ` Junio C Hamano
2019-06-19 19:31         ` Emily Shaffer
2019-06-19 21:30           ` Jeff King
2019-06-19 20:56       ` [PATCH v5] " Emily Shaffer
2019-06-19 21:38         ` Jeff King

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=20190618220837.GE100487@google.com \
    --to=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.