git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: RFH: git show HEAD:$SUBMODULE

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 5, 2009, 17:35 UTC
Message-ID
<7vwsc4eqh2.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.1.00.0902051744520.7491@intel-tinevez-2-302>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 14 quoted lines
> at the moment, 'show HEAD:$SUBMODULE' fails horribly, as git-show abuses 
> the revision walker to parse the command line parameters, and the revision 
> walker does not like a non-existing commit.
>
> Instead, it would be nicer to show the user something like
>
> 	HEAD:$SUBMODULE
> 	submodule at commit $COMMIT_NAME
>
> However, I have no clue how to go about getting that.  I want to avoid 
> having to parse the parameters twice, but I also do not want to fsck up 
> the revision walker...
>
> Ideas?

This is not an idea but it falls into the same category as handling this in a way different from the current code.

	$ cd Documentation
        $ git show HEAD:git.txt

You really shouldn't letting revision machinery to parse it if you want to see these work in the way you want, because both in your example and in the often asked-for "relative to cwd" example, what you are *asking for* is not just an object name, but you are using the mechanism that is meant to be used for one.

I personally think reusing the "object name" syntax for either of the above usages is a mistake, though. If HEAD:$submodule_path is a notation for naming an object (which happens to resolve to a commit) and HEAD:git.txt is a notation for naming a blob object that is found at the top level of the tree-ish that can be called HEAD, they should retain the same meaning throughout the system and "git show" shouldn't be messing with the semantics of the notation.

Previous: Johannes Schindelin
Message 2 of 2 in “RFH: git show HEAD:$SUBMODULE”
  1. Johannes SchindelinFeb 5, 2009
  2. Junio C HamanoFeb 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.