{"thread":{"id":"18330","subject":"undoing something","startedAt":"2009-03-16T19:06:31Z","lastAt":"2009-03-17T16:46:22Z","messageCount":15,"participants":["John Dlugosz","Junio C Hamano","René Scharfe","Nanako Shiraishi","Jay Soffian","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"108111","messageId":"450196A1AAAE4B42A00A8B27A59278E70A2AEFA4@EXCHANGE.trad.tradestation.com","threadId":"18330","inReplyTo":null,"subject":"undoing something","fromName":"John Dlugosz","fromEmail":"jdlugosz@tradestation.com","sentAt":"2009-03-16T19:06:31Z","receivedAt":"2009-03-16T19:06:31Z","isPatch":false,"sender":{"key":"jdlugosz@tradestation.com","avatar":null},"body":"I made a mistake.  Big deal, now that I know that git storage is\nimmutable and changes just add to what's already there.  \n\nA quick look at\n\tgit reflog show topic\ntells me that {1} is the one I want.  So, how do I rewind branch topic\nto point to topic@{1} ?\nI did it by making a tag, and then in gitk pointing to it and picking\n\"reset to here\" from the context menu.  \n\nA while back I was looking for the right/easy way to simply repoint my\nbranch to where I wanted.  The best answer was to use push.  But, I\nwonder if gitk and other high-level commands simply call a more\nprimitive command that does this?  And can I call it directly?  Or is\npush with a dot as the repository just doing this with no excessive\nprocessing and trust that the side-effects are all vacuous?\n\n--John\n(please excuse the footer; it's not my choice)\n\nTradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.\n  If you received this in error, please contact the sender and delete the material from any computer.\n"},{"id":"108112","messageId":"7veiwxwa9z.fsf@gitster.siamese.dyndns.org","threadId":"18330","inReplyTo":"450196A1AAAE4B42A00A8B27A59278E70A2AEFA4@EXCHANGE.trad.tradestation.com","subject":"Re: undoing something","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-16T19:14:00Z","receivedAt":"2009-03-16T19:14:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"John Dlugosz\" <JDlugosz@TradeStation.com> writes:\n\n> I made a mistake.  Big deal, now that I know that git storage is\n> immutable and changes just add to what's already there.  \n>\n> A quick look at\n> \tgit reflog show topic\n> tells me that {1} is the one I want.  So, how do I rewind branch topic\n> to point to topic@{1} ?\n> I did it by making a tag, and then in gitk pointing to it and picking\n> \"reset to here\" from the context menu.  \n>\n> A while back I was looking for the right/easy way to simply repoint my\n> branch to where I wanted.  The best answer was to use push.\n\nThe answer was best only because in your previous question you wanted to\nensure fast-forwardness, i.e. \"git push . origin/dev:dev\" without plus in\nfront to cause it to fail if it is not fast-forward.\n\nIf you know you have one unwanted commit you would want to discard at the\ntip of topic, you do not want fast-foward safety to kick in.\n\n (1) if you are on the topic branch, you can say \"git reset --hard HEAD^\";\n     or\n\n (2) if you are not, you can obviously check out topic and do the above,\n     or \"git branch -f topic topic^\".\n\nIf the garbage you have at the tip of the topic is not just a single\ncommit, you can replace HEAD^ and topic^ in the above with whatever commit\nyou would want to point the tip at.\n"},{"id":"108113","messageId":"450196A1AAAE4B42A00A8B27A59278E70A2AEFD7@EXCHANGE.trad.tradestation.com","threadId":"18330","inReplyTo":"7veiwxwa9z.fsf@gitster.siamese.dyndns.org","subject":"RE: undoing something","fromName":"John Dlugosz","fromEmail":"jdlugosz@tradestation.com","sentAt":"2009-03-16T19:48:20Z","receivedAt":"2009-03-16T19:48:20Z","isPatch":false,"sender":{"key":"jdlugosz@tradestation.com","avatar":null},"body":"=== Re: ===\nThe answer was best only because in your previous question you wanted to\nensure fast-forwardness, i.e. \"git push . origin/dev:dev\" without plus\nin\nfront to cause it to fail if it is not fast-forward.\n=== end ===\n\nNo, I don't want to ensure ff.  The remote may have been changed in\nother ways.  Though in that case I will avoid doing so; when it is not\nthe case it's even more important to see that your local copy is\ndifferent, and understand the tree, rather than blindly pulling.\n\n=== Re: ===\nIf you know you have one unwanted commit you would want to discard at\nthe\ntip of topic, you do not want fast-foward safety to kick in.\n\n (1) if you are on the topic branch, you can say \"git reset --hard\nHEAD^\";\n     or\n\n=== end ===\n\nIt was a rebase, so the old value is not under the current, or even\nvisible on the tree.  That's why I needed the reflog to find it.\nTagging it let it appear in gitk.\n\n\n=== Re: ===\n (2) if you are not, you can obviously check out topic and do the above,\n     or \"git branch -f topic topic^\".\n=== end ===\n\nAs documented, this destroys the existing branch and makes a new one.\nThat would, by design, blow away the reflog for that branch.  What I\nwant is a way to re-point it, and record that repointing =in= the\nreflog.  That is, a command-line version that does what I can do with\nthe GUI, but isn't limited to what I can point to with the mouse.\n\n--John\n(please excuse the footer, yadda yadda)\n\nTradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.\n  If you received this in error, please contact the sender and delete the material from any computer.\n"},{"id":"108119","messageId":"7v3addw7mv.fsf@gitster.siamese.dyndns.org","threadId":"18330","inReplyTo":"450196A1AAAE4B42A00A8B27A59278E70A2AEFD7@EXCHANGE.trad.tradestation.com","subject":"Re: undoing something","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-16T20:11:04Z","receivedAt":"2009-03-16T20:11:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"John Dlugosz\" <JDlugosz@TradeStation.com> writes:\n\n> === Re: ===\n> The answer was best only because in your previous question you wanted to\n> ensure fast-forwardness, i.e. \"git push . origin/dev:dev\" without plus\n> in\n> front to cause it to fail if it is not fast-forward.\n> === end ===\n\nThis is offtopic, but *PLEASE* notice that nobody else quotes like this\naround here.  I find the style of quoting makes it unnecessarily harder to\nskip over parts that others wrote (and I've already read---so I do not\nwant to waste my time on re-reading them) to get to what you are adding to\nthe discussion quickly, and extremely annoying.  It is the reason why I am\nskipping many of your replies to other people without reading to the end,\neven when I suspect you might be saying something worth reading.\n\n> No, I don't want to ensure ff.\n\nI was referring to the exchange that started with this message from you:\n\nFrom: \"John Dlugosz\" <JDlugosz@TradeStation.com>\nDate: Fri, 6 Mar 2009 14:04:25 -0500\nMessage-ID: <450196A1AAAE4B42A00A8B27A59278E70A115E0D@EXCHANGE.trad.tradestation.com>\n\nwhere you asked:\n\n> I want to advocate running\n> \n>         git fetch\n> \n> as being a safe thing to do at any time, just to refresh your view of\n> the origin and not mess up any of your local labels.  That is, you can\n> see the difference between the local dev and the origin/dev.\n> \n> So, after inspecting the changes, how do you fast-forward your local dev\n> to sync up with origin/dev?\n\nand I gave you an answer (with a typo you corrected in another message\ntoday) \"git push . origin/dev:dev\".  In that context, you clearly want to\nencure fast-forward, and local push without + is an easy and safe way to\ndo so.\n\nThat is where \"it is best only because\" came from.  If you are not\ninterested in ensuring fast-forward, \"local push\" may not be best, and\nthere are other ways (I've shown you at least two, so I won't repeat\nthem) to choose from.\n"},{"id":"108138","messageId":"450196A1AAAE4B42A00A8B27A59278E70A2AF031@EXCHANGE.trad.tradestation.com","threadId":"18330","inReplyTo":"7v3addw7mv.fsf@gitster.siamese.dyndns.org","subject":"Effective Posting","fromName":"John Dlugosz","fromEmail":"jdlugosz@tradestation.com","sentAt":"2009-03-16T20:51:49Z","receivedAt":"2009-03-16T20:51:49Z","isPatch":false,"sender":{"key":"jdlugosz@tradestation.com","avatar":null},"body":"If you can tell me how to make Outlook insert >'s in front of a block of\ntext, I'm all ears.  I can't find any kind of \"quote content\" or \"paste\nas quotation\" on the menus, or any option to do anything with the\noriginal message other than to put it at the end with ---original\nmessage--- in front of it.  This was the best I could figure out that\nwas useful, and gets replies threaded (mostly) properly.  While you're\nat it, how do you tell Outlook to always start a message in \"plain text\"\n(not HTML) based on the target address, like Thunderbird does?\n\nAlternatively, tell me how to reply using the Gmane web viewer, or point\nme to another web-based viewer that shows current content.\n\nOr, the mailing list server could translate Outlook's visible\ninterspersed quotes (the original message is blue, new typing is black)\nwith a uniform quote style that is specified in each subscriber's\npreference settings.\n\nCould be worse.  Ever use Lotus Notes?\n\n--John\n\n\n-----Original Message-----\nFrom: Junio C Hamano [mailto:gitster@pobox.com] \nSent: Monday, March 16, 2009 3:11 PM\nTo: John Dlugosz\nCc: git@vger.kernel.org\nSubject: Re: undoing something\n\n\"John Dlugosz\" <JDlugosz@TradeStation.com> writes:\n\n> === Re: ===\n> The answer was best only because in your previous question you wanted\nto\n> ensure fast-forwardness, i.e. \"git push . origin/dev:dev\" without plus\n> in\n> front to cause it to fail if it is not fast-forward.\n> === end ===\n\nThis is offtopic, but *PLEASE* notice that nobody else quotes like this\naround here.  I find the style of quoting makes it unnecessarily harder\nto\nskip over parts that others wrote (and I've already read---so I do not\nwant to waste my time on re-reading them) to get to what you are adding\nto\nthe discussion quickly, and extremely annoying.  It is the reason why I\nam\nskipping many of your replies to other people without reading to the\nend,\neven when I suspect you might be saying something worth reading.\n\n\n\n\nTradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.\n  If you received this in error, please contact the sender and delete the material from any computer.\n"},{"id":"108143","messageId":"49BEC4B4.6070305@lsrfire.ath.cx","threadId":"18330","inReplyTo":"450196A1AAAE4B42A00A8B27A59278E70A2AF031@EXCHANGE.trad.tradestation.com","subject":"Re: Effective Posting","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2009-03-16T21:29:24Z","receivedAt":"2009-03-16T21:29:24Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"John Dlugosz schrieb:\n> If you can tell me how to make Outlook insert >'s in front of a block\n>  of text, I'm all ears.  I can't find any kind of \"quote content\" or \n> \"paste as quotation\" on the menus, or any option to do anything with \n> the original message other than to put it at the end with ---original\n>  message--- in front of it.  This was the best I could figure out \n> that was useful, and gets replies threaded (mostly) properly.\n\nTools -> Options -> Preferences -> E-mail Options, set \"When replying to\na message\" to \"Prefix each line of the original message\".\n\n> While you're at it, how do you tell Outlook to always start a message\n>  in \"plain text\" (not HTML) based on the target address, like \n> Thunderbird does?\n\nTools -> Options -> Mail Format, set \"Compose in this message format\" to\n\"Plain Text\".\n\n> Alternatively, tell me how to reply using the Gmane web viewer, or \n> point me to another web-based viewer that shows current content.\n\nNo idea.  But why not use a real mail user agent?\n\n> Or, the mailing list server could translate Outlook's visible \n> interspersed quotes (the original message is blue, new typing is \n> black) with a uniform quote style that is specified in each \n> subscriber's preference settings.\n\nAvoiding garbage is better than converting it to something useful.  If\nsomeone wrote an Outlook mail sanitizer, I'd probably use it at work,\ntoo, though.\n\n> Could be worse.  Ever use Lotus Notes?\n\nYes, long ago, and thankfully I don't remember much about it.  There's\nalways a way to do worse -- that's small comfort.\n\nRené\n"},{"id":"108144","messageId":"450196A1AAAE4B42A00A8B27A59278E70A2AF076@EXCHANGE.trad.tradestation.com","threadId":"18330","inReplyTo":"49BEC4B4.6070305@lsrfire.ath.cx","subject":"RE: Effective Posting","fromName":"John Dlugosz","fromEmail":"jdlugosz@tradestation.com","sentAt":"2009-03-16T21:38:19Z","receivedAt":"2009-03-16T21:38:19Z","isPatch":false,"sender":{"key":"jdlugosz@tradestation.com","avatar":null},"body":"> Tools -> Options -> Preferences -> E-mail Options, set \"When replying\n> to\n> a message\" to \"Prefix each line of the original message\".\n\nThat worked.  Thanks.\n\n\n> No idea.  But why not use a real mail user agent?\n\nBecause I'm using git for work, on work time, so I'm using the work computer.  It uses \"exchange\" instead of a real mail server.  Perhaps there are better mailers that work with Exchange, but it might not do everything the \"groupware\" stuff does, and that would affect the team interaction.  Also, there is a matter of \"group policy\" which means I'm not in full control of my own machine.\n\nThe web is barely usable from here, too.  The censor is set up, I guess, to stop ordinary desktop users like secretaries and accountants from doing anything to their machine, so the very things I'm interested in -- Windows tools, development topics, anything under ftp: -- is blocked !\n\n--John\n(now if the list mailer could strip off that footer that's longer than some of my postings...)\n\nTradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.\n  If you received this in error, please contact the sender and delete the material from any computer.\n"},{"id":"108145","messageId":"20090317064519.6117@nanako3.lavabit.com","threadId":"18330","inReplyTo":"450196A1AAAE4B42A00A8B27A59278E70A2AEFD7@EXCHANGE.trad.tradestation.com","subject":"(unknown)","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-03-16T21:45:19Z","receivedAt":"2009-03-16T21:45:19Z","isPatch":false,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting John Dlugosz <JDlugosz@TradeStation.com>:\n\n> === Re: ===\n>  (2) if you are not, you can obviously check out topic and do the above,\n>      or \"git branch -f topic topic^\".\n> === end ===\n>\n> As documented, this destroys the existing branch and makes a new one.\n> That would, by design, blow away the reflog for that branch.\n\nDoes it?  If so I think you have an incorrect documentation.\n\n$ rm -fr /tmp/gomi && mkdir /tmp/gomi\n$ cd /tmp/gomi\n$ git init\n$ echo hello >world\n$ git add world\n$ git commit -m initial\n$ seq 1 100 | while read num; do echo $num >world; git commit -a -m $num; done\n$ git checkout -b side master~60\n$ git branch -f master master@{20}\n$ git log --oneline -g master | head -n 10\n0acf8c1 master@{0}: branch: Reset from master@{20}\n945c3ee master@{1}: commit: 100\n54fcb36 master@{2}: commit: 99\nb314a1e master@{3}: commit: 98\ne91d999 master@{4}: commit: 97\n0d88853 master@{5}: commit: 96\n0124315 master@{6}: commit: 95\n5df2cc5 master@{7}: commit: 94\n14bb58e master@{8}: commit: 93\n0813a46 master@{9}: commit: 92\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"108151","messageId":"76718490903161521x33f9375ewa43903be202de905@mail.gmail.com","threadId":"18330","inReplyTo":"450196A1AAAE4B42A00A8B27A59278E70A2AF031@EXCHANGE.trad.tradestation.com","subject":"Re: Effective Posting","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-16T22:21:22Z","receivedAt":"2009-03-16T22:21:22Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Mon, Mar 16, 2009 at 4:51 PM, John Dlugosz <JDlugosz@tradestation.com> wrote:\n> Alternatively, tell me how to reply using the Gmane web viewer\n\nGmane accepts submissions via NNTP. Thunderbird is a capable NNTP client.\n\n> or point me to another web-based viewer that shows current content.\n\nPerhaps sign up for a <insert favorite webmail provider here, mine is\ngmail> account?\n\nBut, this is seriously off-topic for this list, me thinks.\n\nj.\n"},{"id":"108155","messageId":"450196A1AAAE4B42A00A8B27A59278E70A2AF0AE@EXCHANGE.trad.tradestation.com","threadId":"18330","inReplyTo":"76718490903161521x33f9375ewa43903be202de905@mail.gmail.com","subject":"RE: Effective Posting","fromName":"John Dlugosz","fromEmail":"jdlugosz@tradestation.com","sentAt":"2009-03-16T22:36:25Z","receivedAt":"2009-03-16T22:36:25Z","isPatch":false,"sender":{"key":"jdlugosz@tradestation.com","avatar":null},"body":"No NNTP access, and webmail is expressly forbidden.  Actually, any URL that looks like it might be a web mail account is blocked.\n\nI'm using NNTP when at home, on the weekend or whatever.  It makes it easier to reply in-thread.  And I'm using Thunderbird.\n\n--John\n\n> -----Original Message-----\n> From: Jay Soffian [mailto:jaysoffian@gmail.com]\n> Sent: Monday, March 16, 2009 5:21 PM\n> To: John Dlugosz\n> Cc: Junio C Hamano; git@vger.kernel.org\n> Subject: Re: Effective Posting\n> \n> On Mon, Mar 16, 2009 at 4:51 PM, John Dlugosz\n> <JDlugosz@tradestation.com> wrote:\n> > Alternatively, tell me how to reply using the Gmane web viewer\n> \n> Gmane accepts submissions via NNTP. Thunderbird is a capable NNTP\n> client.\n> \n> > or point me to another web-based viewer that shows current content.\n> \n> Perhaps sign up for a <insert favorite webmail provider here, mine is\n> gmail> account?\n> \n> But, this is seriously off-topic for this list, me thinks.\n> \n> j.\n\nTradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.\n"},{"id":"108183","messageId":"7vtz5ssk0s.fsf@gitster.siamese.dyndns.org","threadId":"18330","inReplyTo":"20090317064519.6117@nanako3.lavabit.com","subject":"Re: undoing something","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-17T07:09:23Z","receivedAt":"2009-03-17T07:09:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nanako Shiraishi <nanako3@lavabit.com> writes:\n\n> Quoting John Dlugosz <JDlugosz@TradeStation.com>:\n>\n>> === Re: ===\n>>  (2) if you are not, you can obviously check out topic and do the above,\n>>      or \"git branch -f topic topic^\".\n>> === end ===\n>>\n>> As documented, this destroys the existing branch and makes a new one.\n>> That would, by design, blow away the reflog for that branch.\n>\n> Does it?  If so I think you have an incorrect documentation.\n>\n> $ rm -fr /tmp/gomi && mkdir /tmp/gomi\n> $ cd /tmp/gomi\n> $ git init\n> $ echo hello >world\n> $ git add world\n> $ git commit -m initial\n> $ seq 1 100 | while read num; do echo $num >world; git commit -a -m $num; done\n> $ git checkout -b side master~60\n> $ git branch -f master master@{20}\n> $ git log --oneline -g master | head -n 10\n> 0acf8c1 master@{0}: branch: Reset from master@{20}\n> 945c3ee master@{1}: commit: 100\n> 54fcb36 master@{2}: commit: 99\n> b314a1e master@{3}: commit: 98\n> e91d999 master@{4}: commit: 97\n> 0d88853 master@{5}: commit: 96\n> 0124315 master@{6}: commit: 95\n> 5df2cc5 master@{7}: commit: 94\n> ...\n> 0813a46 master@{9}: commit: 92\n\nI didn't even notice there was another question buried.  Thanks.\n\nDocumentation/git-branch.txt says this:\n\n        -f::\n                Force the creation of a new branch even if it means deleting\n                a branch that already exists with the same name.\n\nwhich does imply that it first destroys the branch altogether and\nrecreates as if there was no such branch.\n\nBut that is actually not what the code does to reflog, and I think the\nbehaviour makes a lot more sense than \"destroy and create\" the\ndocumentation implies.  branch.c::create_branch() has this:\n\n\tif (forcing)\n\t\tsnprintf(msg, sizeof msg, \"branch: Reset from %s\",\n\t\t\t start_name);\n\telse\n\t\tsnprintf(msg, sizeof msg, \"branch: Created from %s\",\n\t\t\t start_name);\n\nThe message for your master@{0} example came from the \"forcing\" codepath.\n\nThe documentation is indeed wrong.  It is more like \"create a new branch,\nor if the named branch already exists, reset the tip of it\".  If we want\nto sound alarmist, we could add \"even if it means making the existing\nhistory unreachable from the new tip of the branch\", but I think \"reset\"\nalready means that and it would be redundant.\n\nThe create_branch() function does another thing, though.  It sets up the\ntracking information _if asked_.  Because one branch cannot track more\nthan one \"other things\" at once, it inevitably overwrites the previous\ntracking information if you say \"branch --track -f dev origin/dev\" if dev\nwere tracking something else.  But if you do not let it set up tracking,\nthe old tracking configuration is _not_ discarded.  I am not sure if that\nwas intended (the branch.<name>.remote nor branch.<name>.merge variables\nare not something I use myself), but it makes sort of sense.  If you do\n\"git branch -f dev dev~2\" to rewind its tip, you do not want to lose its\ntracking information, so the current behaviour makes sense in that\nrespect.\n\nI am not sure about how branch.autsetupmerge does interact with this in\nthe current code, nor how it should interact with it in the ideal world,\nthough.  That's for interested parties (I suspect Jay and Paolo?) to\nfigure out.\n"},{"id":"108228","messageId":"1237298780-11304-1-git-send-email-git@drmicha.warpmail.net","threadId":"18330","inReplyTo":"7vtz5ssk0s.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] git-branch.txt: document -f correctly","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-17T14:06:20Z","receivedAt":"2009-03-17T14:06:20Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"'git branch -f a b' resets a to b when a exists, rather then deleting a.\nSay so in the documentation.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nSomething like this?\n\nBTW, I noticed that 'git-subcmd' is used everywhere in here which does\nnot feel right, but I followed the existing style, leaving a consistent\nclean-up for a later patch. Also, typesetting is inconsistent:\nWe have <branch> as well as `<branch>` when the text talks about the\noptions. Do we have a style guide or such?\n\n Documentation/git-branch.txt |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\nindex 6103d62..27b73bc 100644\n--- a/Documentation/git-branch.txt\n+++ b/Documentation/git-branch.txt\n@@ -76,8 +76,8 @@ OPTIONS\n \tbased sha1 expressions such as \"<branchname>@\\{yesterday}\".\n \n -f::\n-\tForce the creation of a new branch even if it means deleting\n-\ta branch that already exists with the same name.\n+\tReset <branchname> to <startpoint> if <branchname> exists\n+\talready. Without `-f` 'git-branch' refuses to change an existing branch.\n \n -m::\n \tMove/rename a branch and the corresponding reflog.\n-- \n1.6.2.149.g6462\n"},{"id":"108233","messageId":"450196A1AAAE4B42A00A8B27A59278E70A2AF242@EXCHANGE.trad.tradestation.com","threadId":"18330","inReplyTo":"7vtz5ssk0s.fsf@gitster.siamese.dyndns.org","subject":"RE: undoing something","fromName":"John Dlugosz","fromEmail":"jdlugosz@tradestation.com","sentAt":"2009-03-17T15:08:23Z","receivedAt":"2009-03-17T15:08:23Z","isPatch":false,"sender":{"key":"jdlugosz@tradestation.com","avatar":null},"body":"> The documentation is indeed wrong.  It is more like \"create a new\n> branch,\n> or if the named branch already exists, reset the tip of it\".  \n\nAwesome.  Then  git branch -f name newpos  is exactly what I need.  \n\nI wondered why something that should be so simple, and is available from\nevery GUI, is not easy from the command line.\n\n--John\n\n\nTradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.\n  If you received this in error, please contact the sender and delete the material from any computer.\n"},{"id":"108255","messageId":"7vy6v4qf4o.fsf@gitster.siamese.dyndns.org","threadId":"18330","inReplyTo":"1237298780-11304-1-git-send-email-git@drmicha.warpmail.net","subject":"Re: [PATCH] git-branch.txt: document -f correctly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-17T16:37:59Z","receivedAt":"2009-03-17T16:37:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> 'git branch -f a b' resets a to b when a exists, rather then deleting a.\n> Say so in the documentation.\n>\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> ---\n> Something like this?\n>\n> BTW, I noticed that 'git-subcmd' is used everywhere in here which does\n> not feel right, but I followed the existing style, leaving a consistent\n> clean-up for a later patch. Also, typesetting is inconsistent:\n> We have <branch> as well as `<branch>` when the text talks about the\n> options. Do we have a style guide or such?\n>\n>  Documentation/git-branch.txt |    4 ++--\n>  1 files changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\n> index 6103d62..27b73bc 100644\n> --- a/Documentation/git-branch.txt\n> +++ b/Documentation/git-branch.txt\n> @@ -76,8 +76,8 @@ OPTIONS\n>  \tbased sha1 expressions such as \"<branchname>@\\{yesterday}\".\n>  \n>  -f::\n> -\tForce the creation of a new branch even if it means deleting\n> -\ta branch that already exists with the same name.\n> +\tReset <branchname> to <startpoint> if <branchname> exists\n> +\talready. Without `-f` 'git-branch' refuses to change an existing branch.\n\nAnd what happens if the branchname does not exist?\n\n>  \n>  -m::\n>  \tMove/rename a branch and the corresponding reflog.\n> -- \n> 1.6.2.149.g6462\n"},{"id":"108259","messageId":"49BFD3DE.4030901@drmicha.warpmail.net","threadId":"18330","inReplyTo":"7vy6v4qf4o.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-branch.txt: document -f correctly","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-17T16:46:22Z","receivedAt":"2009-03-17T16:46:22Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 17.03.2009 17:37:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n>> 'git branch -f a b' resets a to b when a exists, rather then deleting a.\n>> Say so in the documentation.\n>>\n>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n>> ---\n>> Something like this?\n>>\n>> BTW, I noticed that 'git-subcmd' is used everywhere in here which does\n>> not feel right, but I followed the existing style, leaving a consistent\n>> clean-up for a later patch. Also, typesetting is inconsistent:\n>> We have <branch> as well as `<branch>` when the text talks about the\n>> options. Do we have a style guide or such?\n>>\n>>  Documentation/git-branch.txt |    4 ++--\n>>  1 files changed, 2 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt\n>> index 6103d62..27b73bc 100644\n>> --- a/Documentation/git-branch.txt\n>> +++ b/Documentation/git-branch.txt\n>> @@ -76,8 +76,8 @@ OPTIONS\n>>  \tbased sha1 expressions such as \"<branchname>@\\{yesterday}\".\n>>  \n>>  -f::\n>> -\tForce the creation of a new branch even if it means deleting\n>> -\ta branch that already exists with the same name.\n>> +\tReset <branchname> to <startpoint> if <branchname> exists\n>> +\talready. Without `-f` 'git-branch' refuses to change an existing branch.\n> \n> And what happens if the branchname does not exist?\n\nWell, the standard behaviour of \"git branch\" is described in the\n\"description\", the meaning of the options under \"options\"...\nWe could add\n\n\tIf <branchname> does not exist it is created and '-f' has no effect.\n\nalthough that seems a bit talkative.\n\n> \n>>  \n>>  -m::\n>>  \tMove/rename a branch and the corresponding reflog.\n>> -- \n>> 1.6.2.149.g6462\n"}]}