git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tejun Heo <tj@kernel.org>
Cc: git@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v2] name_rev: add support for --cherry-picks
Date: Thu, 26 Jul 2018 08:12:45 -0700	[thread overview]
Message-ID: <xmqqa7qerpxu.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180726143930.GW1934745@devbig577.frc2.facebook.com> (Tejun Heo's message of "Thu, 26 Jul 2018 07:39:30 -0700")

Tejun Heo <tj@kernel.org> writes:

> From a6a88c3da252d69547ac8b463098fc4f4c03f322 Mon Sep 17 00:00:00 2001
> From: Tejun Heo <tj@kernel.org>
> Date: Thu, 26 Jul 2018 04:14:52 -0700
> Subject: [PATCH] name_rev: add support for --cherry-picks

The above belongs to the mail header, not the body.

> It's often useful to track cherry-picks of a given commit.  Add
> --cherry-picks support to git-name-rev.  When specified, name_rev also
> shows the commits cherry-picked from the listed target commits with
> indentations.
>
>   $ git name-rev --cherry-picks 10f7ce0a0e524279f022
>   10f7ce0a0e524279f022 master~1
>     d433e3b4d5a19b3d29e2c8349fe88ceade5f6190 branch1
>       82cddd79f962de0bb1e7cdd95d48b48633335816 branch2
>     58a8d36b2532feb0a14b4fc2a50d587e64f38324 branch3
>     fa8b79edc5dfff21753c2ccfc1a1828336c4c070 branch4~1

"git name-rev X" asks "I want to know about X".  And the first line
of the above tells us that 10f7ce is the first parent of the master
branch.  What does the second line tell us?  10f7ce was created by
cherry picking d433e3b4 which sits at the tip of branch1?

It appears that you are showing the reverse (d433e3, 58a8d3 and
fa8b79 sit next to each other, but it cannot be that 10f7ce was
created by cherry-picking these three).  I do not mean to say that
the reverse information is not useful thing to learn about the
commit (i.e. "X got cherry-picked to all these places") but I am
having a hard time convincing myself that the feature sits well in
"describe" and "name-rev".

> Note that branch2 is further indented because it's a nested cherry
> pick from d433e3b4d5a1.
>
> "git-describe --contains" is a wrapper around git-name-rev.  Also add
> --cherry-picks support to git-describe.
>
> v2: - Remove a warning message for a malformed cherry-picked tag.
>       There isn't much user can do about it.
>     - Continue scanning cherry-pick tags until a working one is found
>       instead of aborting after trying the last one.  It might miss
>       nesting but still better to show than miss the commit entirely.

  reply	other threads:[~2018-07-26 15:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 12:13 [PATCH] name_rev: add support for --cherry-picks Tejun Heo
2018-07-26 14:39 ` [PATCH v2] " Tejun Heo
2018-07-26 15:12   ` Junio C Hamano [this message]
2018-07-26 15:37     ` Tejun Heo
2018-07-26 19:01       ` Junio C Hamano
2018-07-27  8:40         ` Jeff King
2018-07-27 14:47           ` Tejun Heo
2018-07-27 15:55             ` 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

  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=xmqqa7qerpxu.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kernel-team@fb.com \
    --cc=tj@kernel.org \
    /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).