{"thread":{"id":"8135","subject":"~ and ^","startedAt":"2007-05-13T18:44:42Z","lastAt":"2007-05-13T20:31:02Z","messageCount":6,"participants":["Sean","Junio C Hamano","Karl Hasselström","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"42040","messageId":"20070513144442.b3cba792.seanlkml@sympatico.ca","threadId":"8135","inReplyTo":null,"subject":"~ and ^","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2007-05-13T18:44:42Z","receivedAt":"2007-05-13T18:44:42Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"\nWould it be possible/reasonable to treat a bare ~3 (or ^) on the git command\nline as equivalent to \"<current branch>~3\" ?    At least @{3} already works\nthis way and it would be nice to do the same for the even more common tilde\nand hat operations.  If so, it would be a small convenience to just type:\n\"git show ~3\"\n\nThanks,\nSean\n"},{"id":"42045","messageId":"7v8xbssfti.fsf@assigned-by-dhcp.cox.net","threadId":"8135","inReplyTo":"20070513144442.b3cba792.seanlkml@sympatico.ca","subject":"Re: ~ and ^","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-13T19:07:21Z","receivedAt":"2007-05-13T19:07:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sean <seanlkml@sympatico.ca> writes:\n\n> Would it be possible/reasonable to treat a bare ~3 (or ^) on the git command\n> line as equivalent to \"<current branch>~3\" ?    At least @{3} already works\n> this way and it would be nice to do the same for the even more common tilde\n> and hat operations.  If so, it would be a small convenience to just type:\n> \"git show ~3\"\n\nInteresting.\n\nAt least, \"ls ~0\" does not seem to get confused by bash to be\nthe home directory of the root user, so I do not offhand think\nof a reason not to have ~$n as a synonym to HEAD~$n.  Would that\nbe useful?  I dunno.\n\nP.S.\n\nWelcome back to the list ;-)\n"},{"id":"42047","messageId":"20070513191350.GB14657@diana.vm.bytemark.co.uk","threadId":"8135","inReplyTo":"7v8xbssfti.fsf@assigned-by-dhcp.cox.net","subject":"Re: ~ and ^","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-05-13T19:13:50Z","receivedAt":"2007-05-13T19:13:50Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-05-13 12:07:21 -0700, Junio C Hamano wrote:\n\n> Sean <seanlkml@sympatico.ca> writes:\n>\n> > Would it be possible/reasonable to treat a bare ~3 (or ^) on the\n> > git command line as equivalent to \"<current branch>~3\" ? At least\n> > @{3} already works this way and it would be nice to do the same\n> > for the even more common tilde and hat operations. If so, it would\n> > be a small convenience to just type: \"git show ~3\"\n>\n> Interesting.\n\nYes. I think we should have this, even if just for consistency.\n\n> At least, \"ls ~0\" does not seem to get confused by bash to be the\n> home directory of the root user, so I do not offhand think of a\n> reason not to have ~$n as a synonym to HEAD~$n.\n\nIt seems that ~foo is only expanded to foo's home if there is such a\nuser. Since all-numeric users probably aren't common, we can probably\nget away with it.\n\n> Would that be useful? I dunno.\n\nIt would allow you to say\n\n  git log ~5..\n\ninstead of\n\n  git log HEAD~5..\n\nso I'd say it is useful.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"42049","messageId":"20070513151709.76b5fc33.seanlkml@sympatico.ca","threadId":"8135","inReplyTo":"7v8xbssfti.fsf@assigned-by-dhcp.cox.net","subject":"Re: ~ and ^","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2007-05-13T19:17:09Z","receivedAt":"2007-05-13T19:17:09Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Sun, 13 May 2007 12:07:21 -0700\nJunio C Hamano <junkio@cox.net> wrote:\n\n> Interesting.\n> \n> At least, \"ls ~0\" does not seem to get confused by bash to be\n> the home directory of the root user, so I do not offhand think\n> of a reason not to have ~$n as a synonym to HEAD~$n.  Would that\n> be useful?  I dunno.\n\nNot going to shake the world but it's a small convenience.  Would be\na bit nicer if a lone ~ worked as well without escaping, but I'm not\nsure you'd accept a patch to assume \"~\" whenever git is passed the\nusers home directory as a lone option ;)\n\n> P.S.\n> \n> Welcome back to the list ;-)\n> \n\nThanks.\n\nSean\n"},{"id":"42051","messageId":"20070513154905.36da94e1.seanlkml@sympatico.ca","threadId":"8135","inReplyTo":"20070513191350.GB14657@diana.vm.bytemark.co.uk","subject":"Re: ~ and ^","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2007-05-13T19:49:05Z","receivedAt":"2007-05-13T19:49:05Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Sun, 13 May 2007 21:13:50 +0200\nKarl Hasselström <kha@treskal.com> wrote:\n\n> It seems that ~foo is only expanded to foo's home if there is such a\n> user. Since all-numeric users probably aren't common, we can probably\n> get away with it.\n\nSomeone just mentioned to me that ~# is expanded by Bash if you use the\npushd command to keep a directory stack.   So ~1 will stop working\nif you use \"pushd\".   Maybe it'd be more confusing than helpful.  On the\nother hand, there's probably no reason for Git to just give an error\nmessage if it receives a properly escaped lone \"~\", \"~#\", or \"^\".\n\nSean\n"},{"id":"42054","messageId":"200705132231.03180.robin.rosenberg.lists@dewire.com","threadId":"8135","inReplyTo":"7v8xbssfti.fsf@assigned-by-dhcp.cox.net","subject":"Re: ~ and ^","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-05-13T20:31:02Z","receivedAt":"2007-05-13T20:31:02Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"söndag 13 maj 2007 skrev Junio C Hamano:\n> Sean <seanlkml@sympatico.ca> writes:\n> \n> > Would it be possible/reasonable to treat a bare ~3 (or ^) on the git command\n> > line as equivalent to \"<current branch>~3\" ?    At least @{3} already works\n> > this way and it would be nice to do the same for the even more common tilde\n> > and hat operations.  If so, it would be a small convenience to just type:\n> > \"git show ~3\"\n> \n> Interesting.\n> \n> At least, \"ls ~0\" does not seem to get confused by bash to be\n> the home directory of the root user, so I do not offhand think\n> of a reason not to have ~$n as a synonym to HEAD~$n.  Would that\n> be useful?  I dunno.\n\n~0 is my current directory in bash.\n\n$ echo ~0\n/home/me/tmp\n\n-- robin\n"}]}