{"thread":{"id":"22461","subject":"Wishlist for branch management","startedAt":"2010-02-01T01:18:39Z","lastAt":"2010-02-01T17:49:51Z","messageCount":5,"participants":["H. Peter Anvin","Björn Steinbrink","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"133209","messageId":"4B662BEF.7040503@zytor.com","threadId":"22461","inReplyTo":null,"subject":"Wishlist for branch management","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2010-02-01T01:18:39Z","receivedAt":"2010-02-01T01:18:39Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"A wishlist for better handling of branches:\n\ngit clone --branches\n\n... git clone, with the additional step of setting up local branches for\neach one of the remote branches.\n\ngit branch --current\n\n... list the current branch name, for use in scripts.  Equivalent to:\n\t\"git branch | grep '^\\*' | cut -c3-\"\n\ngit push --current\n\n... push the current branch, and only the current branch...\n\n\t-hpa\n\n-- \nH. Peter Anvin, Intel Open Source Technology Center\nI work for Intel.  I don't speak on their behalf.\n"},{"id":"133210","messageId":"20100201013155.GA11832@atjola.homenet","threadId":"22461","inReplyTo":"4B662BEF.7040503@zytor.com","subject":"Re: Wishlist for branch management","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2010-02-01T01:31:55Z","receivedAt":"2010-02-01T01:31:55Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2010.01.31 17:18:39 -0800, H. Peter Anvin wrote:\n> git branch --current\n> \n> ... list the current branch name, for use in scripts.  Equivalent to:\n> \t\"git branch | grep '^\\*' | cut -c3-\"\n\nIn scripts, plumbing should be used. I use:\n\tgit rev-parse --symbolic-full-name HEAD\n\nThis gives either the full refname of the checked out branch head, e.g.\nrefs/heads/master, or HEAD in case of a detached HEAD.\n\n> git push --current\n> \n> ... push the current branch, and only the current branch...\n\nUnless you want to push to a different ref remotely, e.g. pushing\nrefs/heads/master-public to refs/heads/master, you can use:\n\tgit push <remote> HEAD\n\nFor example, when refs/heads/master is checked out, then:\n\tgit push origin HEAD\nacts the same as:\n\tgit push origin refs/heads/master\n\nBjörn\n"},{"id":"133215","messageId":"4B6648E4.6070805@zytor.com","threadId":"22461","inReplyTo":"20100201013155.GA11832@atjola.homenet","subject":"Re: Wishlist for branch management","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2010-02-01T03:22:12Z","receivedAt":"2010-02-01T03:22:12Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"On 01/31/2010 05:31 PM, Björn Steinbrink wrote:\n> \n>> git push --current\n>>\n>> ... push the current branch, and only the current branch...\n> \n> Unless you want to push to a different ref remotely, e.g. pushing\n> refs/heads/master-public to refs/heads/master, you can use:\n> \tgit push <remote> HEAD\n> \n> For example, when refs/heads/master is checked out, then:\n> \tgit push origin HEAD\n> acts the same as:\n> \tgit push origin refs/heads/master\n> \n\nWhatever is used, it should respect the configuration.  This requires\nknowing what the configuration is set up as.\n\n\t-hpa\n\n-- \nH. Peter Anvin, Intel Open Source Technology Center\nI work for Intel.  I don't speak on their behalf.\n"},{"id":"133235","messageId":"20100201091907.GJ9553@machine.or.cz","threadId":"22461","inReplyTo":"4B662BEF.7040503@zytor.com","subject":"Re: Wishlist for branch management","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2010-02-01T09:19:07Z","receivedAt":"2010-02-01T09:19:07Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Jan 31, 2010 at 05:18:39PM -0800, H. Peter Anvin wrote:\n> A wishlist for better handling of branches:\n> \n> git clone --branches\n> \n> ... git clone, with the additional step of setting up local branches for\n> each one of the remote branches.\n\nYes please! ;-) However, there should be a corresponding command to do\nthis with a remote within existing repository. Perhaps something like\n\n\tgit remote populate\n\n(stealing some syntax from topgit ;-).\n\n> git branch --current\n> \n> ... list the current branch name, for use in scripts.  Equivalent to:\n> \t\"git branch | grep '^\\*' | cut -c3-\"\n\nI'm used to git symbolic-ref HEAD. I like the fact that human-friendly\nand scripting interfaces are mostly separated to different commands.\nThis also has saner behaviour when HEAD is not on a branch. (Which is\nalso a reason why operation like this should be done only when there's\na damn good reason to need to know the branch name.)\n\n> git push --current\n> \n> ... push the current branch, and only the current branch...\n\nYes. Even in the HEAD form, it would be nice to have something that does\nnot require me to write out 'origin' or whatever my remote default is.\nPerhaps `git push - HEAD`. There's certain disparity, we have an alias\nfor the current branch (HEAD) but not for the current remote.\n\nP.S.: I know. It's all just bikeshedding without patches...\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nIf you can't see the value in jet powered ants you should turn in\nyour nerd card. -- Dunbal (464142)\n"},{"id":"133271","messageId":"4B67143F.6090903@zytor.com","threadId":"22461","inReplyTo":"20100201091907.GJ9553@machine.or.cz","subject":"Re: Wishlist for branch management","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2010-02-01T17:49:51Z","receivedAt":"2010-02-01T17:49:51Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"On 02/01/2010 01:19 AM, Petr Baudis wrote:\n> I'm used to git symbolic-ref HEAD. I like the fact that human-friendly\n> and scripting interfaces are mostly separated to different commands.\n\nIt's makes the learning curve for scripting git unnecessarily large.\nFurthermore, it's rather unrealistic for people who are not git people\nto follow this dictum -- I have seen the git scripts that the kernel\npeople write, including myself, and they generally tend to use the same\ncommands they're used to using themselves.\n\nSo I think it's actually a really bad UI design.  It helps making clear\nwhat is scriptable (stable) and what isn't, but expecting people to use\na different mental rubric when scripting than when working on the\ncommand line is completely unrealistic.\n\n\t-hpa\n\n-- \nH. Peter Anvin, Intel Open Source Technology Center\nI work for Intel.  I don't speak on their behalf.\n"}]}