{"thread":{"id":"10786","subject":"git-branch silently ignores --track on local branches","startedAt":"2007-11-10T17:45:57Z","lastAt":"2007-11-11T19:23:38Z","messageCount":3,"participants":["Wayne Davison","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"59226","messageId":"20071110174557.GC1036@blorf.net","threadId":"10786","inReplyTo":null,"subject":"git-branch silently ignores --track on local branches","fromName":"Wayne Davison","fromEmail":"wayne@opencoder.net","sentAt":"2007-11-10T17:45:57Z","receivedAt":"2007-11-10T17:45:57Z","isPatch":false,"sender":{"key":"wayne@opencoder.net","avatar":"https://gravatar.com/avatar/d55d81825271b1bfe65e57e4e04297d4119aa03c6a1c71d2ff2812b9b4be9f45?d=mp&s=160"},"body":"I used to be able to create a branch that tracked master (or another\nlocal branch) by using \"git branch --track new-branch\" from that\nchecked-out branch.  However, this functionality was apparently\nremoved and now the --track option is silently ignored for local\nbranches.  I'd love to have this functionality restored.  Is there\na problem with local branches being supported when explicitly\nrequested?\n\n..wayne..\n"},{"id":"59229","messageId":"7vfxzelz5b.fsf@gitster.siamese.dyndns.org","threadId":"10786","inReplyTo":"20071110174557.GC1036@blorf.net","subject":"Re: git-branch silently ignores --track on local branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-10T18:43:28Z","receivedAt":"2007-11-10T18:43:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Wayne Davison <wayne@opencoder.net> writes:\n\n> ...  Is there\n> a problem with local branches being supported when explicitly\n> requested?\n\nMaybe this one?\n\ncommit 6f084a56fcb3543d88d252bb49c1d2bbf2bd0cf3\nAuthor: Johannes Schindelin <Johannes.Schindelin@gmx.de>\nDate:   Tue Jul 10 18:50:44 2007 +0100\n\n    branch --track: code cleanup and saner handling of local branches\n    \n    This patch cleans up some complicated code, and replaces it with a\n    cleaner version, using code from remote.[ch], which got extended a\n    little in the process.  This also enables us to fix two cases:\n    \n    The earlier \"fix\" to setup tracking only when the original ref started\n    with \"refs/remotes\" is wrong.  You are absolutely allowed to use a\n    separate layout for your tracking branches.  The correct fix, of course,\n    is to set up tracking information only when there is a matching\n    remote.<nick>.fetch line containing a colon.\n    \n    Another corner case was not handled properly.  If two remotes write to\n    the original ref, just warn the user and do not set up tracking.\n    \n    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nAs a local branch does not have to be \"fetched\", the restriction\non \"remote.<nick>.fetch\" is sort of pointless.\n\nAlso why remote.<nick>.fetch needs a colon, I begin to wonder.\nYou can be keep fetching and merging from the same branch of the\nsame remote without keeping a remote tracking branch for that,\nbut the above \"correct fix\" forbids that.\n\nDscho, what were we smoking when we made this change?\n"},{"id":"59359","messageId":"Pine.LNX.4.64.0711111919170.4362@racer.site","threadId":"10786","inReplyTo":"7vfxzelz5b.fsf@gitster.siamese.dyndns.org","subject":"Re: git-branch silently ignores --track on local branches","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-11T19:23:38Z","receivedAt":"2007-11-11T19:23:38Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 10 Nov 2007, Junio C Hamano wrote:\n\n> Wayne Davison <wayne@opencoder.net> writes:\n> \n> > ...  Is there\n> > a problem with local branches being supported when explicitly\n> > requested?\n> \n> Maybe this one?\n> \n> commit 6f084a56fcb3543d88d252bb49c1d2bbf2bd0cf3\n> Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n> Date:   Tue Jul 10 18:50:44 2007 +0100\n> \n>     branch --track: code cleanup and saner handling of local branches\n>     \n>     This patch cleans up some complicated code, and replaces it with a\n>     cleaner version, using code from remote.[ch], which got extended a\n>     little in the process.  This also enables us to fix two cases:\n>     \n>     The earlier \"fix\" to setup tracking only when the original ref started\n>     with \"refs/remotes\" is wrong.  You are absolutely allowed to use a\n>     separate layout for your tracking branches.  The correct fix, of course,\n>     is to set up tracking information only when there is a matching\n>     remote.<nick>.fetch line containing a colon.\n>     \n>     Another corner case was not handled properly.  If two remotes write to\n>     the original ref, just warn the user and do not set up tracking.\n>     \n>     Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> \n> As a local branch does not have to be \"fetched\", the restriction\n> on \"remote.<nick>.fetch\" is sort of pointless.\n\nIIRC it was you, Junio, who complained first that the local branches have \ntracking set up.\n\n> Also why remote.<nick>.fetch needs a colon, I begin to wonder. You can \n> be keep fetching and merging from the same branch of the same remote \n> without keeping a remote tracking branch for that, but the above \n> \"correct fix\" forbids that.\n\nThe point here was to find out what to track when we do a \"git branch \n--track <name> <origname>\".  So we definitely only want to find those \nremotes that fetch to a certain tracking branch.\n\nSure, you can set up branch.<x>.merge to a branch that is not tracked.  \nBut git cannot find out which one it is in the command \"branch\".\n\n> Dscho, what were we smoking when we made this change?\n\nDude, I, uh, I think I, uh, don't remember.  Peace.\n\nCiao,\nDscho\n"}]}