All of lore.kernel.org
 help / color / mirror / Atom feed
* Extending "extended SHA1" syntax to traverse through gitlinks?
@ 2016-08-20 22:50 Josh Triplett
  2016-08-21 13:46 ` Jakub Narębski
  0 siblings, 1 reply; 13+ messages in thread
From: Josh Triplett @ 2016-08-20 22:50 UTC (permalink / raw)
  To: git

Currently, if you have a branch "somebranch" that contains a gitlink
"somecommit", you can write "somebranch:somecommit" to refer to the
commit, just like a tree or blob.  ("man git-rev-parse" defines this
syntax in the "SPECIFYING REVISIONS" section.)  You can use this
anywhere you can use a committish, including "git show
somebranch:somecommit", "git log somebranch:somecommit..anotherbranch",
or even "git format-patch -1 somebranch:somecommit".

However, you cannot traverse *through* the gitlink to look at files
inside its own tree, or to look at other commits relative to that
commit.  For instance, "somebranch:somecommit:somefile" and
"somebranch:somecommit~3" do not work.

I'd love to have a syntax that allows traversing through the gitlink to
other files or commits.  Ideally, I'd suggest the syntax above, as a
natural extension of the existing extended syntax.

(That syntax would potentially introduce ambiguity if you had a file
named "somecommit:somefile" or "somecommit~3".  That doesn't seem like a
problem, though; the existing syntax already doesn't support accessing a
file named "x..y" or "x...y", so scripts already can't expect to access
arbitrary filenames with that syntax without some kind of quoting, wich
we also don't have.)

Does this seem reasonable?  Would a patch introducing such syntax
(including documentation and tests) be acceptable?

- Josh Triplett

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-08-24 20:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-20 22:50 Extending "extended SHA1" syntax to traverse through gitlinks? Josh Triplett
2016-08-21 13:46 ` Jakub Narębski
2016-08-21 14:26   ` Josh Triplett
2016-08-22 18:39     ` Jakub Narębski
2016-08-23  6:53       ` Josh Triplett
2016-08-23 20:24         ` Jakub Narębski
2016-08-24  5:36           ` Junio C Hamano
2016-08-24 13:16             ` Jakub Narębski
2016-08-24 14:20               ` Josh Triplett
2016-08-24 16:26                 ` Stefan Beller
2016-08-24 17:05                 ` Jakub Narębski
2016-08-24 20:21                   ` Josh Triplett
2016-08-23 16:39       ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.