{"thread":{"id":"23714","subject":"Feature request: relative paths","startedAt":"2010-05-06T06:01:06Z","lastAt":"2010-05-06T09:09:33Z","messageCount":6,"participants":["Eli Barzilay","Jonathan Nieder","Björn Steinbrink","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"141030","messageId":"19426.23330.525936.981066@winooski.ccs.neu.edu","threadId":"23714","inReplyTo":null,"subject":"Feature request: relative paths","fromName":"Eli Barzilay","fromEmail":"eli@barzilay.org","sentAt":"2010-05-06T06:01:06Z","receivedAt":"2010-05-06T06:01:06Z","isPatch":false,"sender":{"key":"eli@barzilay.org","avatar":"https://avatars.githubusercontent.com/u/185905?v=4"},"body":"An svn feature that I used a lot is `svn cat some-file' -- and with\ngit I can get close to that with `git show :some-file', except that\nunlike other paths, it must be an absolute path from the repository\nroot.  I could obviously make up a script that will do it, but that's\njust buying myself some time until I find some other command where\nI'll want to use it.\n\nIt looks like it would be relatively easy to do this, since when I do\nspecify the relative path I get an error message suggesting the full\none (provided that the relative path is simple -- no \"..\" etc).  So,\nnow that I can actually UTSL, I went there, and tried some half-assed\nhacking -- I made it so \"::path\" uses the prefix and normalizes the\nresult, so, for example\n\n  cd git/Documentation\n  git show ::../Documentation/./user-manual.conf\n\nworks as expected.  Using \"::\" looks bad IMO, and the hack I did is\nlikely suffering from some problems, but overall it doesn't look too\nhard.\n\n-- \n          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:\n                    http://barzilay.org/                   Maze is Life!\n"},{"id":"141048","messageId":"20100506083113.GA25993@progeny.tock","threadId":"23714","inReplyTo":"19426.23330.525936.981066@winooski.ccs.neu.edu","subject":"Re: Feature request: relative paths","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-05-06T08:31:13Z","receivedAt":"2010-05-06T08:31:13Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Eli Barzilay wrote:\n\n> An svn feature that I used a lot is `svn cat some-file' -- and with\n> git I can get close to that with `git show :some-file'\n\ngit show -- some-file\n\nHope that helps,\nJonathan\n"},{"id":"141051","messageId":"20100506084607.GA9921@atjola.homenet","threadId":"23714","inReplyTo":"20100506083113.GA25993@progeny.tock","subject":"Re: Feature request: relative paths","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2010-05-06T08:46:07Z","receivedAt":"2010-05-06T08:46:07Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2010.05.06 03:31:13 -0500, Jonathan Nieder wrote:\n> Eli Barzilay wrote:\n> \n> > An svn feature that I used a lot is `svn cat some-file' -- and with\n> > git I can get close to that with `git show :some-file'\n> \n> git show -- some-file\n\nThat's the same as \"git show HEAD -- some-file\" though, which shows a\ncommit with path-limited diff output. While \":some-file\" (most likely)\nidentifies a blob, so \"git show :some-file\" shows the contents stored in\nthat blob.\n\nBjörn\n"},{"id":"141053","messageId":"20100506090132.GA26079@progeny.tock","threadId":"23714","inReplyTo":"20100506084607.GA9921@atjola.homenet","subject":"Re: Feature request: relative paths","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-05-06T09:01:33Z","receivedAt":"2010-05-06T09:01:33Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Björn Steinbrink wrote:\n> On 2010.05.06 03:31:13 -0500, Jonathan Nieder wrote:\n\n>> git show -- some-file\n>\n> That's the same as \"git show HEAD -- some-file\" though, which shows a\n> commit with path-limited diff output.\n\nThanks for catching the thinko.\n\n> While \":some-file\" (most likely)\n> identifies a blob, so \"git show :some-file\" shows the contents stored in\n> that blob.\n\nI suggest reviving Dscho’s :./ syntax[1].\n\nCheers,\nJonathan\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/68786/focus=68905\n"},{"id":"141054","messageId":"20100506090419.GB31873@coredump.intra.peff.net","threadId":"23714","inReplyTo":"20100506084607.GA9921@atjola.homenet","subject":"Re: Feature request: relative paths","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-05-06T09:04:19Z","receivedAt":"2010-05-06T09:04:19Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 06, 2010 at 10:46:07AM +0200, Björn Steinbrink wrote:\n\n> > git show -- some-file\n> \n> That's the same as \"git show HEAD -- some-file\" though, which shows a\n> commit with path-limited diff output. While \":some-file\" (most likely)\n> identifies a blob, so \"git show :some-file\" shows the contents stored in\n> that blob.\n\nYep. What Eli actually wants is to allow relative path specifiers in\ntree-selectors. So you could do:\n\n  git show :./some-file\n\nor even\n\n  git show HEAD~20:./some-file\n\nand the \"./\" bit would magically expand into the current prefix within\nthe working tree.\n\nThis has come up several times on the list. It is a little bit of a\nlayering violation, because \"treeish:path\" may or may not bear any\nresemblence to your current working tree. And the parsing of that syntax\nhappens in a fairly deep, library-ish place which doesn't know anything\nabout the working tree. However, in practice, I think it would be\nextremely useful (because your working tree _does_ tend to be related to\nthe tree-ishs that you look at, especially if that tree-ish is HEAD).\n\nI think in the past there was some vague negative sentiment around the\nissues I described above. I don't think an actual patch was ever\nproduced, but I might be wrong. I suspect the only way to move the\ndiscussion forward would be to actually show a patch.\n\n-Peff\n"},{"id":"141056","messageId":"20100506090933.GC31873@coredump.intra.peff.net","threadId":"23714","inReplyTo":"20100506090132.GA26079@progeny.tock","subject":"Re: Feature request: relative paths","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-05-06T09:09:33Z","receivedAt":"2010-05-06T09:09:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 06, 2010 at 04:01:33AM -0500, Jonathan Nieder wrote:\n\n> I suggest reviving Dscho’s :./ syntax[1].\n> [1] http://thread.gmane.org/gmane.comp.version-control.git/68786/focus=68905\n\nOops, I was wrong about \"there is no patch\" (apparently I even submitted\na followup!).\n\nYes, I think that patch is a sane start, but it needs some cleanup.\n\n-Peff\n"}]}