git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] document the <tree ish> <file> blob reference syntax
@ 2006-10-25 10:42 Andy Whitcroft
  2006-10-25 18:33 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Whitcroft @ 2006-10-25 10:42 UTC (permalink / raw)
  To: git

It is possible to specify a specific file within a tree-ish
symbolically.  For example you can find the contents of
a specific file in a specific commit as below:

	git cat-file -p v1.2.4:git-prune.sh

Document this syntax in the Symbolic Identifiers section
of the main git documentation and reference it from
git-cat-file's documentation.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 5e9cbf8..9f2138d 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -19,7 +19,9 @@ or '-s' is used to find the object size.
 OPTIONS
 -------
 <object>::
-	The sha1 identifier of the object.
+	The sha1 identifier of the object or a symbolic object
+	reference.  See the Symbolic Identifiers section of the
+	main git manual page.
 
 -t::
 	Instead of the content, show the object type identified by
@@ -58,6 +60,18 @@ Otherwise the raw (though uncompressed) 
 be returned.
 
 
+EXAMPLES
+--------
+git cat-file -p c5a5d29aaacf753b70e715169cbb7f74f0193e4a::
+	Pretty print the object directly using an sha1, perhaps
+	from a git ls-tree output.
+
+git cat-file -p v1.2.4:git-prune.sh::
+	Output the file git-prune.sh from the branch or tag v1.2.4.
+	Note that where the name is ambigious a heads/ or tags/
+	prefix may be used to disambiguate the name.
+
+
 Author
 ------
 Written by Linus Torvalds <torvalds@osdl.org>
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 7074e32..e9f99e2 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -565,6 +565,13 @@ HEAD::
 	a valid head 'name'
 	(i.e. the contents of `$GIT_DIR/refs/heads/<head>`).
 
+Some commands will also accept the following extended syntax:
+
+<tree-ish>:<file>::
+	indicating a specific blob for that file within the tree
+	object specified, which may also be symbolic.  For example
+	'v1.2.4:git-prune.sh'.
+
 
 File/Directory Structure

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

* Re: [PATCH] document the <tree ish> <file> blob reference syntax
  2006-10-25 10:42 [PATCH] document the <tree ish> <file> blob reference syntax Andy Whitcroft
@ 2006-10-25 18:33 ` Junio C Hamano
  2006-10-25 19:40   ` Andy Whitcroft
  2006-10-25 20:04   ` Jakub Narebski
  0 siblings, 2 replies; 5+ messages in thread
From: Junio C Hamano @ 2006-10-25 18:33 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: git

Andy Whitcroft <apw@shadowen.org> writes:

> It is possible to specify a specific file within a tree-ish
> symbolically.  For example you can find the contents of
> a specific file in a specific commit as below:
>
> 	git cat-file -p v1.2.4:git-prune.sh

Didn't we document this elsewhere recently in git-rev-parse?
How about this instead?

-- >8 --
[PATCH] Refer to git-rev-parse:Specifying Revisions from git.txt

The brief list given in "Symbolic Identifiers" section of the
main documentation is good enough for overview, but help the
reader to find a more comrehensive list as needed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 Documentation/git.txt |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Documentation/git.txt b/Documentation/git.txt
index 3af6fc6..b00607e 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -562,6 +562,9 @@ HEAD::
 	a valid head 'name'
 	(i.e. the contents of `$GIT_DIR/refs/heads/<head>`).
 
+For a more complete list of ways to spell object names, see
+"SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1].
+
 
 File/Directory Structure
 ------------------------
-- 
1.4.3.2.gc1a4


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

* Re: [PATCH] document the <tree ish> <file> blob reference syntax
  2006-10-25 18:33 ` Junio C Hamano
@ 2006-10-25 19:40   ` Andy Whitcroft
  2006-10-25 20:13     ` Junio C Hamano
  2006-10-25 20:04   ` Jakub Narebski
  1 sibling, 1 reply; 5+ messages in thread
From: Andy Whitcroft @ 2006-10-25 19:40 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano wrote:
> Andy Whitcroft <apw@shadowen.org> writes:
> 
>> It is possible to specify a specific file within a tree-ish
>> symbolically.  For example you can find the contents of
>> a specific file in a specific commit as below:
>>
>> 	git cat-file -p v1.2.4:git-prune.sh
> 
> Didn't we document this elsewhere recently in git-rev-parse?
> How about this instead?
> 
> -- >8 --
> [PATCH] Refer to git-rev-parse:Specifying Revisions from git.txt
> 
> The brief list given in "Symbolic Identifiers" section of the
> main documentation is good enough for overview, but help the
> reader to find a more comrehensive list as needed.
> 
> Signed-off-by: Junio C Hamano <junkio@cox.net>
> ---
>  Documentation/git.txt |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/git.txt b/Documentation/git.txt
> index 3af6fc6..b00607e 100644
> --- a/Documentation/git.txt
> +++ b/Documentation/git.txt
> @@ -562,6 +562,9 @@ HEAD::
>  	a valid head 'name'
>  	(i.e. the contents of `$GIT_DIR/refs/heads/<head>`).
>  
> +For a more complete list of ways to spell object names, see
> +"SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1].
> +

That section seems to have more compresensive descriptions of the
various definitions of commit-ish, but not a tree-ish.  Specifically,
there is no mentions of tree-ish:file


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

* Re: [PATCH] document the <tree ish> <file> blob reference syntax
  2006-10-25 18:33 ` Junio C Hamano
  2006-10-25 19:40   ` Andy Whitcroft
@ 2006-10-25 20:04   ` Jakub Narebski
  1 sibling, 0 replies; 5+ messages in thread
From: Jakub Narebski @ 2006-10-25 20:04 UTC (permalink / raw)
  To: git

Junio C Hamano wrote:

> Andy Whitcroft <apw@shadowen.org> writes:
> 
>> It is possible to specify a specific file within a tree-ish
>> symbolically.  For example you can find the contents of
>> a specific file in a specific commit as below:
>>
>>       git cat-file -p v1.2.4:git-prune.sh
> 
> Didn't we document this elsewhere recently in git-rev-parse?
> How about this instead?

Redundancy in documentation is (usually) good idea. Perhaps
both?

P.S. "recently" as in "Thu Oct 19 10:04:55 2006 +0700" in 'master',
commit v1.4.3-g6b09c78
-- 
Jakub Narebski
Poland

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

* Re: [PATCH] document the <tree ish> <file> blob reference syntax
  2006-10-25 19:40   ` Andy Whitcroft
@ 2006-10-25 20:13     ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2006-10-25 20:13 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: git

Andy Whitcroft <apw@shadowen.org> writes:

>> +For a more complete list of ways to spell object names, see
>> +"SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1].
>> +
>
> That section seems to have more compresensive descriptions of the
> various definitions of commit-ish, but not a tree-ish.  Specifically,
> there is no mentions of tree-ish:file

  164 * A suffix ':' followed by a path; this names the blob or tree
  165   at the given path in the tree-ish object named by the part
  166   before the colon.


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

end of thread, other threads:[~2006-10-25 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 10:42 [PATCH] document the <tree ish> <file> blob reference syntax Andy Whitcroft
2006-10-25 18:33 ` Junio C Hamano
2006-10-25 19:40   ` Andy Whitcroft
2006-10-25 20:13     ` Junio C Hamano
2006-10-25 20:04   ` Jakub Narebski

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).