Ksummit-Discuss Archive on lore.kernel.org
 help / color / Atom feed
From: Eric Wong <e@80x24.org>
To: Doug Anderson <dianders@chromium.org>
Cc: ksummit-discuss@lists.linuxfoundation.org
Subject: Re: [Ksummit-discuss] Allowing something Change-Id (or something like it) in kernel commits
Date: Thu, 5 Sep 2019 08:12:19 +0000
Message-ID: <20190905081219.GA26003@dcvr> (raw)
In-Reply-To: <CAD=FV=UPjPpUyFTPjF-Ogzj_6LJLE4PTxMhCoCEDmH1LXSSmpQ@mail.gmail.com>

Doug Anderson <dianders@chromium.org> wrote:
> Hi,
> 
> As everyone is probably aware, when you use the gerrit code review
> system all of your commits get an extra line in them that looks
> something like:
> 
> Change-Id: I6a007dfe91ee1077a437963cf26d91370fdd9556
> 
> The Linux kernel has always viewed these Change-Id tags as obnoxious
> and useless spam.  Anyone who accidentally leaves a Change-Id in their
> patch when posting to the mailing list is told to please re-post their
> patch without the Change-Id.  In this email, I will attempt to argue
> that the Linux kernel ought to relax this restriction and allow
> (possibly even encourage) Change-Ids.

Hello Doug, sometimes-present public-inbox author here, chiming
in late, replying off Mailman-mangled archives...

> To begin with, let me make sure we're on the same page about what
> Change-Ids are.  As I understand it:
> 
> * A change ID is much alike a UUID.  It is locally generated on a
> developer's computer and is (in theory) unique across the universe.
> 
> * When a developer keeps the same Change-Id across two patches they
> are making the assertion that the two patches are either the same or
> should be treated as two versions of the same logical change.  For
> instance, v1, v2, and v3 of the same patch should have the same
> Change-Id.  Even if v2 and v3 of the patch have different subjects and
> touch different files, if they have the same Change-Id then the
> developer is asserting that v3 should be considered a new version of
> the same logical change as v2.  If it helps to think about it,
> Change-Id is used by gerrit servers to know that a new patch uploaded
> should replace an older version with the same Change-Id.

This sounds like the debates around rename-tracking in VCSes
circa 2005.

Other VCSes at the time had explicit rename tracking; git was
(and still is :) powerful enough to infer renames without extra
input from the user.

Drawing inspiration from git from not having "arch-id:" tags
or other cruft for rename-tracking; MY philosophy is to have
"Really Powerful Search" being able to tie things together
after-the-fact without user intervention.

The "Really Powerful Search" part is something I've been working
on in public-inbox off-and-on for a few years :)

> Specifically, let me list the problems I'd like to solve:
> 
> 1. If I see a commit in Linux, I would like to be able to easily find
> all of the mailing list discussions relevant to that commit.  I know
> there are proposals about including the Message-Id of the final post
> in the commit log and that is certainly better than nothing, but the
> Message-Id will only get you a link to the final version of the patch.
> If the relevant discussion happened on a previous version of that
> patch then you need to find it yourself.  This gets harder if the
> patch changed subject, touched different files, if parts of the series
> landed at different times, and if multiple people were involved in
> posting different versions of the patch.  If the commit in Linux has a
> Change-Id then the old versions are logically linked and easier to
> associated with one another.
> 
> 2. If I do a search through old mailing list archives and I stumble
> upon a patch that didn't land, I can more easily find different
> versions of that patch if I have a Change-Id.  Some of these different
> versions may have relevant discussions that explains why the patch
> didn't land.  Finding these other patches without a Change-Id might be
> hard, again because they may touch different files, have a different
> subject, or have been posted by a different person.

I'm curious if you're taking advantage some of the public-inbox
search features (in lore.kernel.org) which is designed with
patches in mind.

1. "Phrase searching" with double quotes can be combined with the "s:"
   prefix to search most commit titles/subjects (*).

2. The dfa:/dfb: prefixes could be an alternative to "git blame"
   for searching text (and works for pre-git patches)

3. dfpre:/dfpost:/dfblob: can find exact blob SHA-1s

4. date/author can also match the git commit authorship info

5. all or any combination of the above can be combined in a single
   search to improve results

All the Xapian prefixes are documented at $INBOX_URL/_text/help/, e.g:
<https://public-inbox.org/git/_/text/help/>

I'm also planning to support searching for the output of
"git patch-id --stable" in the future.  public-inbox also lacks
pairity with "mairix -t" (being able to grab an entire thread
if on message in the thread matches).

> At the moment using a Change-Id in the way I described would require
> searching through mailing lists for the Change-Id string to find other
> versions of the same patch.  However, I would expect it would only be
> a matter of time before tools like patchwork are able to use Change-Id
> to associate one version of a patch with the next version.  I would
> also expect that allowing Change-Id to exist would allow someone to
> (perhaps) create a gerrit instance that watched the kernel mailing
> list and mirrored mailing list discussions in the GUI.  In other
> words, once such tools exist presumably Change-Id will be much more
> useful: you will eventually be able to paste a Change-Id into a tool
> and get links to all relevant discussion and related posts.

(*) I'm also linking the phrase searching through cgit to link
    commit titles to mail discussions shown below:

    https://80x24.org/mirrors/git.git/commit/?id=b777f3fd619ac2af507ffd3e7c5fe0d6e36e81f2
    (following the "xdiff: clamp function context indices in post-image"
     link brings the public-inbox.org/git discussion)

    That's all done with a Lua script supported via cgit:
    https://80x24.org/public-inbox.git/tree/examples/cgit-commit-filter.lua
    It works OK in most cases, but would need to be combined (as
    noted in 5.) for best results.

    I haven't gotten dfpre/dfpost/dfblob/dfa/dfb links working via
    cgit + Lua, yet.  It's on my personal roadmap, some hacking on
    cgit will be needed to expose that info (and I keep getting
    sidetracked on other stuff)

> The basic summary is that I'd like there to be some way to track a
> logical patch over its lifetime.  I don't believe there is a reliable
> (non-heuristic) way to do this today and I think Change-Id provides a
> nice solution.  While we could come up with a new and different
> solution (because Change-Id was not invented here), it feels like
> adopting Change-Id is convenient and easy and provides a true benefit.
> Change-Id works super well with the decentralized/email workflow for
> patches and can be phased in over time (or it can stay optional
> forever).

This sounds exactly like the "arch-id:" comments GNU arch users
used to pollute their sources with for rename tracking :)

It's ugly and made redundant by something which understands
the content.

Change-Id also won't work for historical patches (including
pre-git stuff).  Even without relying on git blob IDs for search,
matching on exact text/phrases is pretty good for pre-git
patches, already.

And back to rename tracking, one yet-to-be-realized promise from
git's lack of explicit tracking was being able to track code
movements (individual functions or hunks, not just entire files).
Having a good search engine gets us there :)

      parent reply index

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 23:39 Doug Anderson
2019-08-23  0:03 ` Brendan Higgins
2019-08-23  0:17 ` Linus Torvalds
2019-08-23  0:30   ` Olof Johansson
2019-08-23  0:43     ` Guenter Roeck
2019-08-23  0:45       ` Olof Johansson
2019-08-23  1:05         ` Olof Johansson
2019-08-23  1:09           ` Dmitry Torokhov
2019-08-23  1:36         ` Theodore Y. Ts'o
2019-08-23  2:58           ` Linus Torvalds
2019-08-23  3:03             ` Linus Torvalds
2019-08-23 13:15               ` Sean Paul
2019-08-23 15:18                 ` Theodore Y. Ts'o
2019-08-23 15:31                   ` Sean Paul
2019-08-23 15:48                     ` Thomas Gleixner
2019-08-23 16:19                       ` Dmitry Torokhov
2019-08-23 16:35                         ` Joel Fernandes
2019-08-23 16:45                           ` Doug Anderson
2019-08-23 16:54                             ` Joel Fernandes
2019-08-23 18:00                               ` Doug Anderson
2019-08-23 19:08                                 ` Joel Fernandes
2019-08-23 19:15                                   ` Joel Fernandes
2019-08-23 19:23                                     ` Thomas Gleixner
2019-08-23 19:31                                       ` Joel Fernandes
2019-08-24 16:53                                   ` Doug Anderson
2019-08-23 16:46                           ` Dmitry Torokhov
2019-08-23 19:17                             ` Thomas Gleixner
2019-08-23 19:38                               ` Laurent Pinchart
2019-08-23 21:15                                 ` Thomas Gleixner
2019-08-23 21:25                                   ` Mark Brown
2019-08-24 23:13                                   ` Theodore Y. Ts'o
2019-08-25  7:09                                     ` Thomas Gleixner
2019-08-26 22:05                                       ` Thomas Gleixner
2019-08-28  8:50                                         ` Thomas Gleixner
2019-08-23 20:02                               ` Christian Brauner
2019-08-24 16:34                                 ` Doug Anderson
2019-08-24 18:11                                   ` Linus Torvalds
2019-08-24 23:04                                     ` Theodore Y. Ts'o
2019-08-25  3:11                                       ` Greg Kroah-Hartman
2019-08-27 10:51                                         ` Mark Brown
2019-09-09  8:14                                           ` Michael Ellerman
2019-09-09 12:09                                             ` Mark Brown
2019-08-26 17:13                                     ` Doug Anderson
2019-08-26 17:30                                       ` Joel Fernandes
2019-08-26 21:35                                         ` Doug Anderson
2019-08-26 21:51                                           ` Thomas Gleixner
2019-08-26 22:06                                             ` Doug Anderson
2019-08-26 22:19                                               ` Thomas Gleixner
2019-08-26 23:02                                           ` Theodore Y. Ts'o
2019-08-26 23:11                                             ` Doug Anderson
2019-09-16 14:11                                               ` Christian Brauner
2019-09-16 17:43                                               ` Al Viro
2019-09-16 18:05                                                 ` Doug Anderson
2019-08-26 23:43                                             ` Thomas Gleixner
2019-08-28 12:34                                               ` Christian Brauner
2019-08-27  0:29                                             ` Dmitry Vyukov
2019-08-27  6:06                                               ` Thomas Gleixner
2019-08-27 13:24                                                 ` Dmitry Vyukov
2019-08-27 13:48                                                   ` Greg Kroah-Hartman
2019-08-27 14:01                                                     ` Guenter Roeck
2019-08-27 14:09                                                       ` Thomas Gleixner
2019-08-27 15:33                                                         ` Greg Kroah-Hartman
2019-08-27 15:42                                                           ` Thomas Gleixner
2019-08-27 18:55                                                           ` Konstantin Ryabitsev
2019-08-27 19:53                                                             ` Greg Kroah-Hartman
2019-08-27 21:34                                                               ` Joel Fernandes
2019-08-27 21:38                                                                 ` Joel Fernandes
2019-08-28  9:08                                                                 ` Greg Kroah-Hartman
2019-08-28  9:25                                                                   ` Jani Nikula
2019-08-28 10:04                                                                   ` Martin K. Petersen
2019-08-28 10:53                                                                     ` Thomas Gleixner
2019-08-28 12:46                                                                       ` Martin K. Petersen
2019-08-28 10:42                                                                   ` Mark Brown
2019-08-28 11:41                                                                     ` Greg Kroah-Hartman
2019-08-28 12:22                                                                   ` Christian Brauner
2019-08-28 12:38                                                                   ` Joel Fernandes
2019-08-28 13:58                                                                     ` Theodore Y. Ts'o
2019-08-28 20:39                                                                       ` Doug Anderson
2019-08-28 20:46                                                                         ` Johannes Berg
2019-08-28 21:00                                                                           ` Doug Anderson
2019-08-28 22:15                                                                         ` Rob Herring
2019-08-27 17:34                                                       ` Geert Uytterhoeven
2019-08-27 18:50                                                         ` Guenter Roeck
2019-08-27 14:06                                                   ` Thomas Gleixner
2019-08-27  7:33                                               ` Geert Uytterhoeven
2019-08-27 13:30                                                 ` Dmitry Vyukov
2019-08-27 14:28                                                   ` Paul E. McKenney
2019-08-27 15:06                                                     ` Thomas Gleixner
2019-08-27 15:25                                                       ` Paul E. McKenney
2019-08-28  8:57                                                         ` Dan Carpenter
2019-08-23 15:49                     ` Doug Anderson
2019-08-23 15:54                       ` Thomas Gleixner
2019-08-23 15:59                         ` Thomas Gleixner
2019-08-23 16:38                           ` Doug Anderson
2019-08-23 16:50                             ` Andrew Lunn
2019-08-23 17:50                               ` Doug Anderson
2019-08-23 18:10               ` Konstantin Ryabitsev
2019-08-26 22:19               ` Paul Mackerras
2019-08-27  7:02                 ` Stephen Rothwell
2019-08-23  9:09             ` Vlastimil Babka
2019-08-23 12:48               ` Bhaskar Chowdhury
2019-08-23  1:01   ` Dmitry Torokhov
2019-08-23  1:07   ` Doug Anderson
2019-08-23  1:18     ` Joel Fernandes
2019-09-05  8:12 ` Eric Wong [this message]

Reply instructions:

You may reply publically 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=20190905081219.GA26003@dcvr \
    --to=e@80x24.org \
    --cc=dianders@chromium.org \
    --cc=ksummit-discuss@lists.linuxfoundation.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

Ksummit-Discuss Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/ksummit-discuss/0 ksummit-discuss/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ksummit-discuss ksummit-discuss/ https://lore.kernel.org/ksummit-discuss \
		ksummit-discuss@lists.linuxfoundation.org
	public-inbox-index ksummit-discuss

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxfoundation.lists.ksummit-discuss


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git