git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Tzu-Jung Lee <roylee17@gmail.com>, git@vger.kernel.org
Subject: Re: Do we have a convenient way to refer to a specific commit in an already filtered rev-list?
Date: Tue, 4 Oct 2011 03:05:29 -0400	[thread overview]
Message-ID: <20111004070529.GA6916@sigill.intra.peff.net> (raw)
In-Reply-To: <7v1uutg8xw.fsf@alter.siamese.dyndns.org>

On Mon, Oct 03, 2011 at 12:40:43PM -0700, Junio C Hamano wrote:

> Tzu-Jung Lee <roylee17@gmail.com> writes:
> 
> > And also teach the rev-list to parse or interpret the 'saved' refs differently.
> > So we can have the following use case:
> >
> >    git log branch_foo --author=some_one -S some_string --saved=cached_ref
> >    git log cached_ref
> >    git cherry-pick cached_ref~4
> >    git format-patch cached_ref~6..cached_ref~2
> >
> > I often have such use cases. not sure others would be benefited from
> > such feature.
> > Just asking for comment. :)
> 
> It feels too much hackery for too little gain.

Agreed. It means that each entry in refs/saved is subtly _not_ a ref,
but rather a list of refs. Until now, most refs are considered equal
with respect to basic things like ref lookup.  So if git were to save
this, I'm not sure refs/ would be the right place. A reflog would be a
bit closer in concept.

But I really don't see the need for git to handle this at all. There is
already a general solution:

> $ git log --oneline master..branch --author=A.U.Thor -Spickaxe >foos.txt
> 
> and working from the text file foos.txt at least would not contaminate any
> ref namespace and you do not have to clean them after you are done.

Which works just as well, and is way more flexible. You have to be a
little more proficient in using the shell, but that is at least a
general skill which transfers to many other programs.

-Peff

      reply	other threads:[~2011-10-04  7:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-24 16:46 Do we have a convenient way to refer to a specific commit in an already filtered rev-list? Tzu-Jung Lee
2011-09-27 21:35 ` Jeff King
2011-10-03 17:19   ` Tzu-Jung Lee
2011-10-03 19:40     ` Junio C Hamano
2011-10-04  7:05       ` Jeff King [this message]

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=20111004070529.GA6916@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=roylee17@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.
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).