git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Regarding "git log" on "git series" metadata
Date: Fri, 4 Nov 2016 15:06:13 -0600	[thread overview]
Message-ID: <20161104210613.5ax523wrc5robs7l@x> (raw)
In-Reply-To: <xmqqa8dfdt6y.fsf@gitster.mtv.corp.google.com>

On Fri, Nov 04, 2016 at 10:57:09AM -0700, Junio C Hamano wrote:
> After your talk at LPC2016, I was thinking about your proposal to
> give an option to hide certain parents from "git log" traversal.
> 
> While I do not think we would terribly mind a new feature in the
> core to support third-party additions like "git series" better, I
> think this particular one is a big mistake that we shouldn't take.
[...]
> I think this is backwards.  The root cause of the issue you have
> with "gitk" is because you added something that is *NOT* a parent to
> your commit.  We shouldn't have to add a mechanism to filter
> something that shouldn't have been added there in the first place.
> 
> I am wondering if an alternative approach would work better.
> 
> Imagine we invent a new tree entry type, "gitref", that is similar
> to "gitlink" in that it can record a commit object name in a tree,
> but unlike "gitlink" it does imply reachability.  And you do not add
> phony parents to your commit object.  A tree that has "gitref"s in
> it is about annotating the commits in the same repository (e.g. the
> tree references two commits, "base" and "tip", to point into a slice
> of the main history).  And it is perfectly sensible for such a
> pointer to imply reachability---after all it serves different
> purposes from "gitlink".

I absolutely agree with this, and I'd love to have gitref or similar in
core git.  Given the availability of that mechanism, I'd love to use it
in git-series.  (And in git submodule, as well, for other projects.)

The one critical issue there, though: that would break backward
compatibility with old versions of git.  No old version of git could
push, pull, gc, repack, or otherwise touch a repository that used this
feature.

The advantages of the approach (viewing and manipulating the series with
pure git) seem sufficiently high to make that worth considering, but it
is a significant downside.

> Another alternative that I am negative about (but is probably a
> better hack than how you abused the "parent" link) might be to add a
> new commit object header field that behaves similarly to "parent"
> only in that it implies reachability.  But recording the extra
> parent in commit object was not something you wanted to do in the
> first place (i.e. your series processing is done solely on the
> contents of the tree, and you do not read this extra parent). If you
> need to add an in-tree reference to another commit in your future
> versions of "git series", with either this variant or your original
> implementation, you would end up needing adding more "parent" (or
> pseudo parent) only to preserve reachability.  At that point, I
> think it makes more sense to have entries in the tree to directly
> ensure reachability, if you want these entries to always point at an
> in-tree object.

This would similarly break compatibility with old git, as old git
wouldn't follow those reachability-only links from commits, so it could
throw away the data.

One approach compatible with old git would be to continue adding the
relevant commits as artificial parents, but have a separate commit
metadata field that says which parents to ignore; old git would then do
the right thing, as long as it doesn't rewrite the commit entirely.

That does have the same disadvantages of having to duplicate the
information in both the tree and the parent list, though; it's the same
class of hack, just with improved usability.  I'd much rather use
gitrefs.

> I am afraid that I probably am two steps ahead of myself, because I
> am reasonably sure that it is quite possible that I have overlooked
> something trivially obvious that makes the "gitref" approach
> unworkable.

gitref seems like a good idea to me, as long as we can sort out the
compatibility story.

      parent reply	other threads:[~2016-11-04 21:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04 17:57 Regarding "git log" on "git series" metadata Junio C Hamano
2016-11-04 19:19 ` Jacob Keller
2016-11-04 19:49   ` Jeff King
2016-11-04 21:55     ` Josh Triplett
2016-11-04 23:37       ` Jacob Keller
2016-11-04 23:46         ` Josh Triplett
2016-11-04 23:34     ` Jacob Keller
2016-11-05  1:48       ` Jeff King
2016-11-05  3:55         ` Josh Triplett
2016-11-05  4:41           ` Jeff King
2016-11-05  4:41     ` Junio C Hamano
2016-11-05  4:44       ` Jeff King
2016-11-05  5:00       ` Junio C Hamano
2016-11-04 20:47 ` Christian Couder
2016-11-04 21:19   ` Josh Triplett
2016-11-04 23:04     ` Christian Couder
2016-11-13 17:50       ` Stefano Zacchiroli
2016-11-05 21:56     ` Christian Couder
2016-11-05  4:42   ` Junio C Hamano
2016-11-05 12:17     ` Christian Couder
2016-11-05 12:45       ` Christian Couder
2016-11-05 15:18         ` Josh Triplett
2016-11-05 20:21           ` Christian Couder
2016-11-05 20:25             ` Josh Triplett
2016-11-06  4:50               ` Jacob Keller
2016-11-06 16:34                 ` Josh Triplett
2016-11-06 17:14                   ` Junio C Hamano
2016-11-06 17:33                     ` Josh Triplett
2016-11-06 20:17                       ` Jacob Keller
2016-11-07  1:18                         ` Josh Triplett
2016-11-07  5:35                           ` Jacob Keller
2016-11-07  9:42                           ` Duy Nguyen
2016-11-07 16:11                             ` Josh Triplett
2016-11-09 22:57                       ` Junio C Hamano
2016-11-04 21:06 ` Josh Triplett [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

  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=20161104210613.5ax523wrc5robs7l@x \
    --to=josh@joshtriplett.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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).