Do we have a convenient way to refer to a specific commit in an already filtered rev-list?

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Do we have a convenient way to refer to a specific commit in an already filtered rev-list?

From: Tzu-Jung Lee <hidden>
Date: 2016-06-15 22:52:06

Hi Folks,

Do we have a convenient/symbolic way to refer  to a specific commit of
an already filtered rev-list? For example, I'm interested in the
commits with some constraints:

    git log somepath --author=someone

Without gui/tui tools, I have to frequently CUT & PASTE the commit-ID
for further manipulation (show, cherry-pick, ...), and possibly repeat
the parsing couple of times if I didn't save the output. I wonder if
we have a convenient way to refer to the discrete commits? like
HEAD~4, HEAD@{3} or something magic.

Thanks,
Roy

Re: Do we have a convenient way to refer to a specific commit in an already filtered rev-list?

From: Jeff King <hidden>
Date: 2016-06-15 22:52:07

On Sun, Sep 25, 2011 at 12:46:20AM +0800, Tzu-Jung Lee wrote:
Do we have a convenient/symbolic way to refer  to a specific commit of
an already filtered rev-list? For example, I'm interested in the
commits with some constraints:

    git log somepath --author=someone

Without gui/tui tools, I have to frequently CUT & PASTE the commit-ID
for further manipulation (show, cherry-pick, ...), and possibly repeat
the parsing couple of times if I didn't save the output. I wonder if
we have a convenient way to refer to the discrete commits? like
HEAD~4, HEAD@{3} or something magic.
Use the shell:

  git rev-list --author=someone HEAD >saved-query
  git log --no-walk --stdin <saved-query
  git cherry-pick `cat saved-query`

or even:

  q=`git rev-list --author=someone HEAD`
  git log --no-walk $q
  git cherry-pick $q

-Peff

Re: Do we have a convenient way to refer to a specific commit in an already filtered rev-list?

From: Tzu-Jung Lee <hidden>
Date: 2016-06-15 22:52:10

On Wed, Sep 28, 2011 at 5:35 AM, Jeff King [off-list ref] wrote:
On Sun, Sep 25, 2011 at 12:46:20AM +0800, Tzu-Jung Lee wrote:
quoted
Do we have a convenient/symbolic way to refer  to a specific commit of
an already filtered rev-list? For example, I'm interested in the
commits with some constraints:

    git log somepath --author=someone

Without gui/tui tools, I have to frequently CUT & PASTE the commit-ID
for further manipulation (show, cherry-pick, ...), and possibly repeat
the parsing couple of times if I didn't save the output. I wonder if
we have a convenient way to refer to the discrete commits? like
HEAD~4, HEAD@{3} or something magic.
Use the shell:

 git rev-list --author=someone HEAD >saved-query
 git log --no-walk --stdin <saved-query
 git cherry-pick `cat saved-query`

or even:

 q=`git rev-list --author=someone HEAD`
 git log --no-walk $q
 git cherry-pick $q

-Peff
Cool, this does record and replay.


How about adding a command or teaching some existing one an option
like --saved=<ref_name>, which put the saved-list to
refs/saved/<ref_name> ?
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. :)

Regards,
Roy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help