{"thread":{"id":"9570","subject":"Getting a file revision","startedAt":"2007-08-19T00:42:30Z","lastAt":"2007-08-21T18:50:36Z","messageCount":11,"participants":["Bahadir Balban","Junio C Hamano","J. Bruce Fields","Jerome Lovy","Miklos Vajna","Johannes Sixt","VMiklos","David Kastrup","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"50990","messageId":"7ac1e90c0708181742w531dab4asc7c90835cc56e8a1@mail.gmail.com","threadId":"9570","inReplyTo":null,"subject":"Getting a file revision","fromName":"Bahadir Balban","fromEmail":"bahadir.balban@gmail.com","sentAt":"2007-08-19T00:42:30Z","receivedAt":"2007-08-19T00:42:30Z","isPatch":false,"sender":{"key":"bahadir.balban@gmail.com","avatar":null},"body":"Hi,\n\nThis might sound like a novice question but anyway: I sometimes have a\nneed to quickly recover an old revision of a file just to check\nsomething or copy some code from it. I would imagine having a command\nlike:\n\ngit-getrev <filename> <commit> or something, and the file would appear\nin its path, or the git root directory as <filename>.<commit>\n\nIs there an existing way to achieve a similar result? I can certainly\ncheckout a branch, revert to that commit I want, copy the file, and\ncome back to HEAD, but its not as quick.\n\nThanks,\nBahadir\n"},{"id":"50991","messageId":"7vir7ccpmj.fsf@gitster.siamese.dyndns.org","threadId":"9570","inReplyTo":"7ac1e90c0708181742w531dab4asc7c90835cc56e8a1@mail.gmail.com","subject":"Re: Getting a file revision","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-19T00:52:20Z","receivedAt":"2007-08-19T00:52:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Bahadir Balban\" <bahadir.balban@gmail.com> writes:\n\n> This might sound like a novice question but anyway: I sometimes have a\n> need to quickly recover an old revision of a file just to check\n> something or copy some code from it.\n\n$ git show -p $commit:$path >$path.old-version\n"},{"id":"50992","messageId":"20070819005229.GA12095@fieldses.org","threadId":"9570","inReplyTo":"7ac1e90c0708181742w531dab4asc7c90835cc56e8a1@mail.gmail.com","subject":"Re: Getting a file revision","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-08-19T00:52:29Z","receivedAt":"2007-08-19T00:52:29Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Sun, Aug 19, 2007 at 01:42:30AM +0100, Bahadir Balban wrote:\n> This might sound like a novice question but anyway: I sometimes have a\n> need to quickly recover an old revision of a file just to check\n> something or copy some code from it. I would imagine having a command\n> like:\n> \n> git-getrev <filename> <commit> or something, and the file would appear\n> in its path, or the git root directory as <filename>.<commit>\n> \n> Is there an existing way to achieve a similar result? I can certainly\n> checkout a branch, revert to that commit I want, copy the file, and\n> come back to HEAD, but its not as quick.\n\nEasiest is probably to use git-show together with the\n<commit>:<filename> syntax, so e.g.:\n\n\tgit show v1.4:src/main.c\n\tgit show 74ace5df:Makefile >Makefile.tmp\n\n--b.\n"},{"id":"51080","messageId":"46C97D26.9090102@brefemail.com","threadId":"9570","inReplyTo":"7vir7ccpmj.fsf@gitster.siamese.dyndns.org","subject":"Re: Getting a file revision","fromName":"Jerome Lovy","fromEmail":"t2a2e9z8ncbs9qg@brefemail.com","sentAt":"2007-08-20T11:38:14Z","receivedAt":"2007-08-20T11:38:14Z","isPatch":false,"sender":{"key":"t2a2e9z8ncbs9qg@brefemail.com","avatar":null},"body":"Hi,\n\nJunio C Hamano wrote:\n> \"Bahadir Balban\" <bahadir.balban@gmail.com> writes:\n> \n>> This might sound like a novice question but anyway: I sometimes have a\n>> need to quickly recover an old revision of a file just to check\n>> something or copy some code from it.\n> \n> $ git show -p $commit:$path >$path.old-version\nIs \"-p\" a short version of \"--pretty\" ?\n\n(I do not see it documented in the man-page and assume it is not the \n\"-p\" applicable to git-diff-tree, is it ?)\n\nThanks,\nJérôme\n"},{"id":"51163","messageId":"20070821124949.GH768@genesis.frugalware.org","threadId":"9570","inReplyTo":"46C97D26.9090102@brefemail.com","subject":"[PATCH] Document the -p option for git-show.","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-08-21T12:49:49Z","receivedAt":"2007-08-21T12:49:49Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n Documentation/git-show.txt |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-show.txt b/Documentation/git-show.txt\nindex a42e121..2409389 100644\n--- a/Documentation/git-show.txt\n+++ b/Documentation/git-show.txt\n@@ -33,6 +33,10 @@ This manual page describes only the most frequently used options.\n \n OPTIONS\n -------\n+\n+-p::\n+\tFor commits, show the change the commit introduces in a patch form.\n+\n <object>::\n \tThe name of the object to show.\n \tFor a more complete list of ways to spell object names, see\n-- \n1.5.2.2\n"},{"id":"51165","messageId":"46CAE41C.4614FDF4@eudaptics.com","threadId":"9570","inReplyTo":"20070821124949.GH768@genesis.frugalware.org","subject":"Re: [PATCH] Document the -p option for git-show.","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-08-21T13:09:48Z","receivedAt":"2007-08-21T13:09:48Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Miklos Vajna wrote:\n> +-p::\n> +       For commits, show the change the commit introduces in a patch form.\n\nThis is already documented by referencing git-diff-tree a few lines\nabove:\n\n\tThe command takes options applicable to the git-diff-tree[1]\n\tcommand to control how the changes the commit introduces are\n\tshown.\n\nThe man page of git-diff-tree talks about -p, and a lot more options.\n\nSide note: -p is the default for git-show (of commits). Nevertheless, it\nmakes sense to specify it in combination with other options:\n\n\tgit show -p --stat\n\nwill show both the patch and the statistics.\n\n-- Hannes\n"},{"id":"51168","messageId":"20070821142915.GI768@genesis.frugalware.org","threadId":"9570","inReplyTo":"46CAE41C.4614FDF4@eudaptics.com","subject":"Re: [PATCH] Document the -p option for git-show.","fromName":"VMiklos","fromEmail":"vmiklos@frugalware.org","sentAt":"2007-08-21T14:29:15Z","receivedAt":"2007-08-21T14:29:15Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hello,\n\nNa Tue, Aug 21, 2007 at 03:09:48PM +0200, Johannes Sixt <J.Sixt@eudaptics.com> pisal(a):\n> This is already documented by referencing git-diff-tree a few lines\n> above:\n> \n> \tThe command takes options applicable to the git-diff-tree[1]\n> \tcommand to control how the changes the commit introduces are\n> \tshown.\n> (..)\n> Side note: -p is the default for git-show (of commits). Nevertheless, it\n> makes sense to specify it in combination with other options:\n> \n> \tgit show -p --stat\n> \n> will show both the patch and the statistics.\n\nHm, but -p is used by default for git show, right? And this is not\ndocumented anywhere IMHO. (Maybe other options are used by default,\ntoo?)\n\n- VMiklos\n"},{"id":"51170","messageId":"867inpexsm.fsf@lola.quinscape.zz","threadId":"9570","inReplyTo":"46CAE41C.4614FDF4@eudaptics.com","subject":"Re: [PATCH] Document the -p option for git-show.","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-21T15:02:01Z","receivedAt":"2007-08-21T15:02:01Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Johannes Sixt <J.Sixt@eudaptics.com> writes:\n\n> Miklos Vajna wrote:\n>> +-p::\n>> +       For commits, show the change the commit introduces in a patch form.\n>\n> This is already documented by referencing git-diff-tree a few lines\n> above:\n>\n> \tThe command takes options applicable to the git-diff-tree[1]\n> \tcommand to control how the changes the commit introduces are\n> \tshown.\n>\n> The man page of git-diff-tree talks about -p, and a lot more\n> options.\n\nI am not really convinced this is a good idea: at the current point of\ntime, man-pages are not pulled into they user manual or any other\ncomplete reference tome.  So they are basically standalone.  Even if\nthey weren't, I think it does not make all too much sense for a\nporcelain command to point to the documentation of a plumbing command\nfor much of its functionality.\n\n-- \nDavid Kastrup\n"},{"id":"51180","messageId":"200708211901.55687.robin.rosenberg.lists@dewire.com","threadId":"9570","inReplyTo":"20070821124949.GH768@genesis.frugalware.org","subject":"Re: [PATCH] Document the -p option for git-show.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-08-21T17:01:55Z","receivedAt":"2007-08-21T17:01:55Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdag 21 augusti 2007 skrev Miklos Vajna:\n> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n> ---\n>  Documentation/git-show.txt |    4 ++++\n>  1 files changed, 4 insertions(+), 0 deletions(-)\n> \n> diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt\n> index a42e121..2409389 100644\n> --- a/Documentation/git-show.txt\n> +++ b/Documentation/git-show.txt\n> @@ -33,6 +33,10 @@ This manual page describes only the most frequently used options.\n>  \n>  OPTIONS\n>  -------\n> +\n> +-p::\n> +\tFor commits, show the change the commit introduces in a patch form.\n> +\n>  <object>::\n>  \tThe name of the object to show.\n>  \tFor a more complete list of ways to spell object names, see\nHow about this instead:\n\n-- robin\n\nInclude diff options into git-show command manual\n\n--\n Documentation/git-show.txt |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-show.txt b/Documentation/git-show.txt\nindex a42e121..d4708e0 100644\n--- a/Documentation/git-show.txt\n+++ b/Documentation/git-show.txt\n@@ -41,6 +41,9 @@ OPTIONS\n include::pretty-options.txt[]\n \n \n+include::diff-options.txt[]\n+\n+\n include::pretty-formats.txt[]\n \n \n"},{"id":"51182","messageId":"7v1wdwpzbd.fsf@gitster.siamese.dyndns.org","threadId":"9570","inReplyTo":"200708211901.55687.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Document the -p option for git-show.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-21T17:33:42Z","receivedAt":"2007-08-21T17:33:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n\n> How about this instead:\n>\n> -- robin\n>\n> Include diff options into git-show command manual\n\nI think that is probably a good idea but I wonder if placing\ndiff-options in between of pretty-options and pretty-formats is\na good idea.\n"},{"id":"51193","messageId":"200708212050.37227.robin.rosenberg.lists@dewire.com","threadId":"9570","inReplyTo":"7v1wdwpzbd.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Document the -p option for git-show.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-08-21T18:50:36Z","receivedAt":"2007-08-21T18:50:36Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdag 21 augusti 2007 skrev Junio C Hamano:\n> Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n> \n> > How about this instead:\n> >\n> > -- robin\n> >\n> > Include diff options into git-show command manual\n> \n> I think that is probably a good idea but I wonder if placing\n> diff-options in between of pretty-options and pretty-formats is\n> a good idea.\n\nSince pretty-formats is a new section in the man page it works out fine. I\nactually ran make and man to verify this patch.\n\n-- robin\n"}]}