{"thread":{"id":"27822","subject":"branch tracking: inherit upstream","startedAt":"2011-07-15T11:09:28Z","lastAt":"2011-07-15T15:51:59Z","messageCount":2,"participants":["Pete Wyckoff","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"171403","messageId":"20110715110928.GA3425@arf.padd.com","threadId":"27822","inReplyTo":null,"subject":"branch tracking: inherit upstream","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2011-07-15T11:09:28Z","receivedAt":"2011-07-15T11:09:28Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"At work, our primary SCM is perforce (p4), but many of us use git\nin front of that for day-to-day work.  The build system requires\ninformation about what part of the P4 repository it is building.\nI've cobbled together changes to make this work with git, and\nhave been using \"git merge-base HEAD @{upstream}\" to find the\ntop-most git-p4 commit.\n\nBut @{upstream} is not automatically inherited by branches.  It\nis fine when a local branch is a normal tracking branch of\norigin/master, like:\n\n    $ git checkout master\n    $ git rev-parse --symbolic-full-name @{upstream}\n    refs/remotes/origin/master\n\nBut I'd also like this to work:\n\n    $ git branch feature\n    $ git checkout feature\n    $ git rev-parse --symbolic-full-name @{upstream}\n    error: No upstream branch found for ''\n    @{upstream}\n    error: No upstream branch found for ''\n    fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree.\n    Use '--' to separate paths from revisions\n\nI know I can do:\n\n    $ git branch --set-upstream feature origin/master\n\nbut that is a pain.  And I know I can track the local master, but\nthat is not what I want.\n\nI'm looking for something like \"branch.autosetupupstream\" that\nwould cause the upstream of new branches to be copied from the\nold branch (when it exists).  Does this make sense?\n\n\t\t-- Pete\n"},{"id":"171405","messageId":"CAG+J_DyxMJtzf2N90vgJjQL1SikUw__KECBhrJWC=SgpYNdG0A@mail.gmail.com","threadId":"27822","inReplyTo":"20110715110928.GA3425@arf.padd.com","subject":"Re: branch tracking: inherit upstream","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-07-15T15:51:59Z","receivedAt":"2011-07-15T15:51:59Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Fri, Jul 15, 2011 at 7:09 AM, Pete Wyckoff <pw@padd.com> wrote:\n> At work, our primary SCM is perforce (p4), but many of us use git\n> in front of that for day-to-day work.  The build system requires\n> information about what part of the P4 repository it is building.\n> I've cobbled together changes to make this work with git, and\n> have been using \"git merge-base HEAD @{upstream}\" to find the\n> top-most git-p4 commit.\n>\n> But @{upstream} is not automatically inherited by branches.  It\n> is fine when a local branch is a normal tracking branch of\n> origin/master, like:\n>\n>    $ git checkout master\n>    $ git rev-parse --symbolic-full-name @{upstream}\n>    refs/remotes/origin/master\n>\n> But I'd also like this to work:\n>\n>    $ git branch feature\n>    $ git checkout feature\n>    $ git rev-parse --symbolic-full-name @{upstream}\n>    error: No upstream branch found for ''\n>    @{upstream}\n>    error: No upstream branch found for ''\n>    fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree.\n>    Use '--' to separate paths from revisions\n>\n> I know I can do:\n>\n>    $ git branch --set-upstream feature origin/master\n>\n> but that is a pain.  And I know I can track the local master, but\n> that is not what I want.\n>\n> I'm looking for something like \"branch.autosetupupstream\" that\n> would cause the upstream of new branches to be copied from the\n> old branch (when it exists).  Does this make sense?\n\nYeah, this is something I'd like to fix:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/168157\n\nj.\n"}]}