{"thread":{"id":"19279","subject":"git branch -a now reports 'remotes/foo' rather than 'foo'?","startedAt":"2009-05-11T02:16:43Z","lastAt":"2009-05-11T07:01:33Z","messageCount":3,"participants":["Daniel Pittman","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"113510","messageId":"87skjcpeno.fsf@rimspace.net","threadId":"19279","inReplyTo":null,"subject":"git branch -a now reports 'remotes/foo' rather than 'foo'?","fromName":"Daniel Pittman","fromEmail":"daniel@rimspace.net","sentAt":"2009-05-11T02:16:43Z","receivedAt":"2009-05-11T02:16:43Z","isPatch":false,"sender":{"key":"daniel@rimspace.net","avatar":"https://gravatar.com/avatar/67f2f02d3521b163f6b7a0dec5943d33fbc5a2a6d9702ab3fef99032e59e692f?d=mp&s=160"},"body":"G'day.  Debian recently released git 1.6.3 to unstable, so it has just\nlanded on my desk, and a change in the output of 'git branch' listings\nis causing one of the front-ends I use to fail.\n\nIn previous versions, in a git-svn repository, I got this output to\n'git branch -a':\n\n,----[ git 1.6.2 and earlier ]\n| ] git branch -a\n| * master\n|   tags/16-1\n|   tags/18-1\n|   tags/19-2\n|   trunk\n`----\n\nNow, in 1.6.3, I see two different output formats:\n\n,----[ git 1.6.3 ]\n| ] git branch -a\n| * master\n|   remotes/tags/16-1\n|   remotes/tags/18-1\n|   remotes/tags/19-2\n|   remotes/trunk\n| ] git branch -r\n|   tags/16-1\n|   tags/18-1\n|   tags/19-2\n|   trunk\n`----\n\nThe front-end I am using looks for a 'trunk' branch by name in the\noutput of 'git branch -a', which historically worked.  Now, though, it\nshows that fully qualified.\n\nLooking at the release notes it looks like this was a deliberate change,\nfrom this entry:\n\n* \"git-branch -r\" shows HEAD symref that points at a remote branch in\n  interest of each tracked remote repository.\n\nHowever, that isn't unambiguously clear about the change, and is pretty\nlight on the \"why\" parts.  Worse, the only discussion I can find about\nthe change suggests that this was noticed, and there wasn't real clarity\nabout the background.\n\n(See Jeff King under \"[PATCH 1/2] add basic branch display tests\" at [1]\n for the details.)\n\n\nI confess, to me, that having 'git branch -a' and 'git branch -r' emit\ndifferent values doesn't make much sense, but I suppose the upstream\ncode can be adapted.\n\nI wanted to confirm that this was a deliberate change before I went to\nthe trouble or rewriting the front-end code however.\n\nRegards,\n        Daniel\n\nFootnotes: \n[1]  http://thread.gmane.org/gmane.comp.version-control.git/110564/focus=110616\n"},{"id":"113515","messageId":"76718490905102226w4cda3a75l5062e1956129dc87@mail.gmail.com","threadId":"19279","inReplyTo":"87skjcpeno.fsf@rimspace.net","subject":"Re: git branch -a now reports 'remotes/foo' rather than 'foo'?","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-05-11T05:26:02Z","receivedAt":"2009-05-11T05:26:02Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sun, May 10, 2009 at 10:16 PM, Daniel Pittman <daniel@rimspace.net> wrote:\n> The front-end I am using looks for a 'trunk' branch by name in the\n> output of 'git branch -a', which historically worked.  Now, though, it\n> shows that fully qualified.\n>\n> Looking at the release notes it looks like this was a deliberate change,\n> from this entry:\n>\n> * \"git-branch -r\" shows HEAD symref that points at a remote branch in\n>  interest of each tracked remote repository.\n>\n> However, that isn't unambiguously clear about the change, and is pretty\n> light on the \"why\" parts.  Worse, the only discussion I can find about\n> the change suggests that this was noticed, and there wasn't real clarity\n> about the background.\n>\n> (See Jeff King under \"[PATCH 1/2] add basic branch display tests\" at [1]\n>  for the details.)\n>\n>\n> I confess, to me, that having 'git branch -a' and 'git branch -r' emit\n> different values doesn't make much sense, but I suppose the upstream\n> code can be adapted.\n>\n> I wanted to confirm that this was a deliberate change before I went to\n> the trouble or rewriting the front-end code however.\n\nYes, the change was deliberate. Commit 209d336 (builtin-branch:\nimprove output when displaying remote branches, 2009-02-13) has more\ndetails:\n\n    When displaying local and remote branches, prefix the remote branch\n    names with \"remotes/\" to make the remote branches clear from the local\n    branches. If displaying only the remote branches, the prefix is not\n    shown since it would be redundant.\n\nWhen you fix your front-end, I suggest you stop parsing git branch's\noutput. It is a so-called porcelain command, as opposed to a  plumbing\ncommand, and so its output is subject to change. You probably want to\nuse the for-each-ref command instead.\n\nj.\n"},{"id":"113517","messageId":"87my9knmwi.fsf@rimspace.net","threadId":"19279","inReplyTo":"76718490905102226w4cda3a75l5062e1956129dc87@mail.gmail.com","subject":"Re: git branch -a now reports 'remotes/foo' rather than 'foo'?","fromName":"Daniel Pittman","fromEmail":"daniel@rimspace.net","sentAt":"2009-05-11T07:01:33Z","receivedAt":"2009-05-11T07:01:33Z","isPatch":false,"sender":{"key":"daniel@rimspace.net","avatar":"https://gravatar.com/avatar/67f2f02d3521b163f6b7a0dec5943d33fbc5a2a6d9702ab3fef99032e59e692f?d=mp&s=160"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n> On Sun, May 10, 2009 at 10:16 PM, Daniel Pittman <daniel@rimspace.net> wrote:\n>> The front-end I am using looks for a 'trunk' branch by name in the\n>> output of 'git branch -a', which historically worked.  Now, though, it\n>> shows that fully qualified.\n\n[...]\n\n>> I wanted to confirm that this was a deliberate change before I went to\n>> the trouble or rewriting the front-end code however.\n>\n> Yes, the change was deliberate. Commit 209d336 (builtin-branch:\n> improve output when displaying remote branches, 2009-02-13) has more\n> details:\n>\n>     When displaying local and remote branches, prefix the remote\n>     branch names with \"remotes/\" to make the remote branches clear\n>     from the local branches.\n\nIsn't the use of colour sufficient to do this?  Ah, well.  That horse,\nI think, has bolted, and my own end-users thoughts about the incoherence\nare, I suspect, of little relevance now.\n\n>     If displaying only the remote branches, the prefix is not shown\n>     since it would be redundant.\n>\n> When you fix your front-end, I suggest you stop parsing git branch's\n> output. It is a so-called porcelain command, as opposed to a plumbing\n> command, and so its output is subject to change. You probably want to\n> use the for-each-ref command instead.\n\nIt isn't my front-end, but I shall take a look and see if I can send\nupstream a suitable patch.  Thanks for the advice.\n\nRegards,\n        Daniel\n"}]}