Re: Getting a file revision

7 messages, 6 authors, 2016-06-15 · open the first message on its own page

Re: Getting a file revision

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:29

"Bahadir Balban" [off-list ref] writes:
This might sound like a novice question but anyway: I sometimes have a
need to quickly recover an old revision of a file just to check
something or copy some code from it.
$ git show -p $commit:$path >$path.old-version

Re: Getting a file revision

From: Jerome Lovy <hidden>
Date: 2016-06-15 22:43:30

Hi,

Junio C Hamano wrote:
"Bahadir Balban" [off-list ref] writes:
quoted
This might sound like a novice question but anyway: I sometimes have a
need to quickly recover an old revision of a file just to check
something or copy some code from it.
$ git show -p $commit:$path >$path.old-version
Is "-p" a short version of "--pretty" ?

(I do not see it documented in the man-page and assume it is not the 
"-p" applicable to git-diff-tree, is it ?)

Thanks,
Jérôme

[PATCH] Document the -p option for git-show.

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:43:30

Signed-off-by: Miklos Vajna <redacted>
---
 Documentation/git-show.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index a42e121..2409389 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -33,6 +33,10 @@ This manual page describes only the most frequently used options.
 
 OPTIONS
 -------
+
+-p::
+	For commits, show the change the commit introduces in a patch form.
+
 <object>::
 	The name of the object to show.
 	For a more complete list of ways to spell object names, see
-- 
1.5.2.2

Re: [PATCH] Document the -p option for git-show.

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:43:30

Miklos Vajna wrote:
+-p::
+       For commits, show the change the commit introduces in a patch form.
This is already documented by referencing git-diff-tree a few lines
above:

	The command takes options applicable to the git-diff-tree[1]
	command to control how the changes the commit introduces are
	shown.

The man page of git-diff-tree talks about -p, and a lot more options.

Side note: -p is the default for git-show (of commits). Nevertheless, it
makes sense to specify it in combination with other options:

	git show -p --stat

will show both the patch and the statistics.

-- Hannes

Re: [PATCH] Document the -p option for git-show.

From: VMiklos <hidden>
Date: 2016-06-15 22:43:30

Hello,

Na Tue, Aug 21, 2007 at 03:09:48PM +0200, Johannes Sixt [off-list ref] pisal(a):
This is already documented by referencing git-diff-tree a few lines
above:

	The command takes options applicable to the git-diff-tree[1]
	command to control how the changes the commit introduces are
	shown.
(..)
Side note: -p is the default for git-show (of commits). Nevertheless, it
makes sense to specify it in combination with other options:

	git show -p --stat

will show both the patch and the statistics.
Hm, but -p is used by default for git show, right? And this is not
documented anywhere IMHO. (Maybe other options are used by default,
too?)

- VMiklos

Re: [PATCH] Document the -p option for git-show.

From: David Kastrup <hidden>
Date: 2016-06-15 22:43:30

Johannes Sixt [off-list ref] writes:
Miklos Vajna wrote:
quoted
+-p::
+       For commits, show the change the commit introduces in a patch form.
This is already documented by referencing git-diff-tree a few lines
above:

	The command takes options applicable to the git-diff-tree[1]
	command to control how the changes the commit introduces are
	shown.

The man page of git-diff-tree talks about -p, and a lot more
options.
I am not really convinced this is a good idea: at the current point of
time, man-pages are not pulled into they user manual or any other
complete reference tome.  So they are basically standalone.  Even if
they weren't, I think it does not make all too much sense for a
porcelain command to point to the documentation of a plumbing command
for much of its functionality.

-- 
David Kastrup

Re: [PATCH] Document the -p option for git-show.

From: Robin Rosenberg <hidden>
Date: 2016-06-15 22:43:30

tisdag 21 augusti 2007 skrev Miklos Vajna:
quoted hunk
Signed-off-by: Miklos Vajna <redacted>
---
 Documentation/git-show.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index a42e121..2409389 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -33,6 +33,10 @@ This manual page describes only the most frequently used options.
 
 OPTIONS
 -------
+
+-p::
+	For commits, show the change the commit introduces in a patch form.
+
 <object>::
 	The name of the object to show.
 	For a more complete list of ways to spell object names, see
How about this instead:

-- robin

Include diff options into git-show command manual

--
 Documentation/git-show.txt |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index a42e121..d4708e0 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -41,6 +41,9 @@ OPTIONS
 include::pretty-options.txt[]
 
 
+include::diff-options.txt[]
+
+
 include::pretty-formats.txt[]
 
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help