From: "Jakub Narębski" <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Josh Triplett <josh@joshtriplett.org>, git@vger.kernel.org
Subject: Re: Extending "extended SHA1" syntax to traverse through gitlinks?
Date: Wed, 24 Aug 2016 15:16:56 +0200 [thread overview]
Message-ID: <b264e17a-12ff-69ca-f130-78d2635a0f85@gmail.com> (raw)
In-Reply-To: <xmqq60qqu3rl.fsf@gitster.mtv.corp.google.com>
W dniu 24.08.2016 o 07:36, Junio C Hamano pisze:
> Jakub Narębski <jnareb@gmail.com> writes:
>
>> The point is that submodule has it's own object database. It might
>> be the same as superproject's, but you need to handle submodule objects
>> being in separate submodule repository anyway. Common repository is
>> just a special case.
>>
>> By the way, this also means that proposed "extended extended SHA1"
>> syntax would be useful to user's of submodules...
>
> Not really.
>
> I think that you gave a prime example why <treeish>:<path1>//<path2>
> is not a useful thing for submodules. When the syntax resolves to a
> 40-hex object name, that object name by itself is not useful.
>
> You also need to carry an additional piece of information that lets
> you identify the location of the repository, in which the object
> name is valid, in the current user's context (i.e. somewhere in the
> superproject where the submodule lives). In other words, you'd need
> to carry <treeish>:<path1> around anyway for the object name to be
> useful, so there is no good reason why anybody should insist that
> the plumbing level resolve <treeish>:<path1>//<path2> directly to an
> object name in the first place.
Not really.
The above means only that the support for new syntax would be not
as easy as adding it to 'git rev-parse' (and it's built-in equivalent),
except for the case where submodule uses the same object database as
supermodule.
So it wouldn't be as easy (on conceptual level) as adding support
for ':/<text>' or '<commit>^{/<text>}'. It would be at least as
hard, if not harder, as adding support for '@{-1}' and its '-'
shortcut.
Josh, what was the reason behind proposing this feature? Was it
conceived as adding completeness to gitrevisions syntax, a low-hanging
fruit? It isn't (the latter). Or was it some problem with submodule
handling that you would want to use this syntax for?
As for usefulness: this fills the hole in accessing submodules, one
that could be handled by combining plumbing-level commands. Namely,
there are 5 states of submodule (as I understand it)
* recorded in ref / commit in supermodule
* recorded in the index in supermodule
- recorded in ref / commit in submodule
- recorded in the index in submodule
- state of worktree in submodule
The last three can be easyly acessed by cd-ing to submodule. The first
two are not easy to get, AFAIUC.
--
Jakub Narębski
next prev parent reply other threads:[~2016-08-24 13:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b264e17a-12ff-69ca-f130-78d2635a0f85@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=josh@joshtriplett.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.
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 NNTP newsgroup(s).