{"thread":{"id":"17041","subject":"fetch branch blacklist","startedAt":"2009-01-08T00:07:43Z","lastAt":"2009-01-10T02:30:24Z","messageCount":3,"participants":["jidanni@jidanni.org","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"99636","messageId":"87r63ek6cw.fsf@jidanni.org","threadId":"17041","inReplyTo":null,"subject":"fetch branch blacklist","fromName":"","fromEmail":"jidanni@jidanni.org","sentAt":"2009-01-08T00:07:43Z","receivedAt":"2009-01-08T00:07:43Z","isPatch":false,"sender":{"key":"jidanni@jidanni.org","avatar":"https://gravatar.com/avatar/36568d4af4c8d3e71627ef3b8c8d00e39065b12f29676cccd38ced75e68fa2a6?d=mp&s=160"},"body":"If one wants to always fetch all except one remote branch, one cannot\njust blacklist it, but must instead whitelist all the rest.\n$ git branch -rd origin/man origin/html\nDeleted remote branch origin/man.\nDeleted remote branch origin/html.\nPlus I edited them out of FETCH_HEAD. Nonetheless, back from the dead:\n$ git pull\nFrom git://git.kernel.org/pub/scm/git/git\n * [new branch]      html       -> origin/html\n * [new branch]      man        -> origin/man\nThe only solution is to change .git/config:\n[remote \"origin\"]\n\turl = git://git.kernel.org/pub/scm/git/git.git\n#\tfetch = +refs/heads/*:refs/remotes/origin/*\n\tfetch = +refs/heads/maint:refs/remotes/origin/maint\n\tfetch = +refs/heads/master:refs/remotes/origin/master\n\tfetch = +refs/heads/next:refs/remotes/origin/next\n\tfetch = +refs/heads/pu:refs/remotes/origin/pu\n\tfetch = +refs/heads/todo:refs/remotes/origin/todo\n(Such explicit whitelisting will also sacrifice automatic addition or\neven notification, if desired, of future new branches too.)\nThere is a remote.<name>.skipDefaultUpdate variable, but it probably\nisn't fine grained enough.\n"},{"id":"99816","messageId":"m3wsd41b7q.fsf@localhost.localdomain","threadId":"17041","inReplyTo":"87r63ek6cw.fsf@jidanni.org","subject":"Re: fetch branch blacklist","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-01-09T20:23:08Z","receivedAt":"2009-01-09T20:23:08Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"jidanni@jidanni.org writes:\n\n> If one wants to always fetch all except one remote branch, one cannot\n> just blacklist it, but must instead whitelist all the rest.\n> $ git branch -rd origin/man origin/html\n> Deleted remote branch origin/man.\n> Deleted remote branch origin/html.\n> Plus I edited them out of FETCH_HEAD. Nonetheless, back from the dead:\n> $ git pull\n> From git://git.kernel.org/pub/scm/git/git\n>  * [new branch]      html       -> origin/html\n>  * [new branch]      man        -> origin/man\n> The only solution is to change .git/config:\n> [remote \"origin\"]\n> \turl = git://git.kernel.org/pub/scm/git/git.git\n> #\tfetch = +refs/heads/*:refs/remotes/origin/*\n> \tfetch = +refs/heads/maint:refs/remotes/origin/maint\n> \tfetch = +refs/heads/master:refs/remotes/origin/master\n> \tfetch = +refs/heads/next:refs/remotes/origin/next\n> \tfetch = +refs/heads/pu:refs/remotes/origin/pu\n> \tfetch = +refs/heads/todo:refs/remotes/origin/todo\n\nWell, you can always use hooks for that (see for example\nunderdocumented contrib/hooks/update-paranoid)... or you can try to\nscratch that itch yourself.  gitignore supports inverse (negated)\npatterns (!<pattern>), so there is some code dealing with\n\"blacklisting\".  I would propose using the same '!' character, or\nperhaps one of forbidden characters (see git-check-ref-format(1)),\ni.e.\n\n [remote \"origin\"]\n \turl = git://git.kernel.org/pub/scm/git/git.git\n \tfetch = +refs/heads/*:refs/remotes/origin/*\n        fetch = !refs/heads/html\n        fetch = !refs/heads/man\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"99848","messageId":"873afr6gfz.fsf@jidanni.org","threadId":"17041","inReplyTo":"m3wsd41b7q.fsf@localhost.localdomain","subject":"Re: fetch branch blacklist","fromName":"","fromEmail":"jidanni@jidanni.org","sentAt":"2009-01-10T02:30:24Z","receivedAt":"2009-01-10T02:30:24Z","isPatch":false,"sender":{"key":"jidanni@jidanni.org","avatar":"https://gravatar.com/avatar/36568d4af4c8d3e71627ef3b8c8d00e39065b12f29676cccd38ced75e68fa2a6?d=mp&s=160"},"body":"If anybody is going to implement this, then the order of the two lines\nfetch=+refs/heads/*:refs/remotes/origin/*\nfetch=!refs/heads/man\nshould probably matter...\n"}]}