{"thread":{"id":"17621","subject":"[TopGit] aborting tg create leafs deleted .top* files in index","startedAt":"2009-02-06T19:03:58Z","lastAt":"2009-02-27T10:59:15Z","messageCount":5,"participants":["Bert Wesarg","Uwe Kleine-König"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"103539","messageId":"36ca99e90902061103u24d4f38eua52d9259cb8d34d1@mail.gmail.com","threadId":"17621","inReplyTo":null,"subject":"[TopGit] aborting tg create leafs deleted .top* files in index","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2009-02-06T19:03:58Z","receivedAt":"2009-02-06T19:03:58Z","isPatch":false,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"Hi,\n\nafter executing the abort commands to remove a just created new topic\nbranch, the .top* files from the previous branch are markes as\ndeleted.\n\nTo reproduce:\n\n$ md g\n$ cd g\n$ git --version\ngit version 1.6.1.rc4\n$ git init\nInitialized empty Git repository in /home/bertw/tmp/g/.git/\n$ touch file\n$ git add file\n$ git commit -m init\n[master (root-commit)]: created 2155efd: \"init\"\n 0 files changed, 0 insertions(+), 0 deletions(-)\n create mode 100644 file\n$ tg create t/test1\ntg: Automatically marking dependency on master\ntg: Creating t/test1 base from master...\nSwitched to a new branch \"t/test1\"\ntg: Topic branch t/test1 set up. Please fill .topmsg now and make\ninitial commit.\ntg: To abort: git rm -f .top* && git checkout master && tg delete t/test1\n$ git commit -m \"topic test1\"\n[t/test1]: created 3cb4fbf: \"topic test1\"\n 2 files changed, 7 insertions(+), 0 deletions(-)\n create mode 100644 .topdeps\n create mode 100644 .topmsg\n$ tg create t/test2\ntg: Automatically marking dependency on t/test1\ntg: Creating t/test2 base from t/test1...\nSwitched to a new branch \"t/test2\"\ntg: Topic branch t/test2 set up. Please fill .topmsg now and make\ninitial commit.\ntg: To abort: git rm -f .top* && git checkout t/test1 && tg delete t/test2\n$ git rm -f .top* && git checkout t/test1 && tg delete t/test2\nrm '.topdeps'\nrm '.topmsg'\nD       .topdeps\nD       .topmsg\nSwitched to branch \"t/test1\"\n$ git status\n# On branch t/test1\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       deleted:    .topdeps\n#       deleted:    .topmsg\n#\n$\n\n\nRegards,\nBert Wesarg\n"},{"id":"106399","messageId":"36ca99e90902262247q783f8ce1j20bdc971cfc22948@mail.gmail.com","threadId":"17621","inReplyTo":"36ca99e90902061103u24d4f38eua52d9259cb8d34d1@mail.gmail.com","subject":"Re: [TopGit] aborting tg create leafs deleted .top* files in index","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2009-02-27T06:47:15Z","receivedAt":"2009-02-27T06:47:15Z","isPatch":false,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Fri, Feb 6, 2009 at 20:03, Bert Wesarg <bert.wesarg@googlemail.com> wrote:\n> Hi,\n>\n> after executing the abort commands to remove a just created new topic\n> branch, the .top* files from the previous branch are markes as\n> deleted.\n>\n> To reproduce:\n>\n> $ md g\n> $ cd g\n> $ git --version\n> git version 1.6.1.rc4\n> $ git init\n> Initialized empty Git repository in /home/bertw/tmp/g/.git/\n> $ touch file\n> $ git add file\n> $ git commit -m init\n> [master (root-commit)]: created 2155efd: \"init\"\n>  0 files changed, 0 insertions(+), 0 deletions(-)\n>  create mode 100644 file\n> $ tg create t/test1\n> tg: Automatically marking dependency on master\n> tg: Creating t/test1 base from master...\n> Switched to a new branch \"t/test1\"\n> tg: Topic branch t/test1 set up. Please fill .topmsg now and make\n> initial commit.\n> tg: To abort: git rm -f .top* && git checkout master && tg delete t/test1\n> $ git commit -m \"topic test1\"\n> [t/test1]: created 3cb4fbf: \"topic test1\"\n>  2 files changed, 7 insertions(+), 0 deletions(-)\n>  create mode 100644 .topdeps\n>  create mode 100644 .topmsg\n> $ tg create t/test2\n> tg: Automatically marking dependency on t/test1\n> tg: Creating t/test2 base from t/test1...\n> Switched to a new branch \"t/test2\"\n> tg: Topic branch t/test2 set up. Please fill .topmsg now and make\n> initial commit.\n> tg: To abort: git rm -f .top* && git checkout t/test1 && tg delete t/test2\n> $ git rm -f .top* && git checkout t/test1 && tg delete t/test2\n> rm '.topdeps'\n> rm '.topmsg'\n> D       .topdeps\n> D       .topmsg\n> Switched to branch \"t/test1\"\n> $ git status\n> # On branch t/test1\n> # Changes to be committed:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #       deleted:    .topdeps\n> #       deleted:    .topmsg\n> #\n> $\nAnyone?\n\n>\n>\n> Regards,\n> Bert Wesarg\n>\n"},{"id":"106408","messageId":"20090227083211.GA10326@pengutronix.de","threadId":"17621","inReplyTo":"36ca99e90902262247q783f8ce1j20bdc971cfc22948@mail.gmail.com","subject":"Re: [TopGit] aborting tg create leafs deleted .top* files in index","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-02-27T08:32:11Z","receivedAt":"2009-02-27T08:32:11Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hi Bert,\n\nOn Fri, Feb 27, 2009 at 07:47:15AM +0100, Bert Wesarg wrote:\n> On Fri, Feb 6, 2009 at 20:03, Bert Wesarg <bert.wesarg@googlemail.com> wrote:\n> > Hi,\n> >\n> > after executing the abort commands to remove a just created new topic\n> > branch, the .top* files from the previous branch are markes as\n> > deleted.\n> >\n> > To reproduce:\n> >\n> > $ md g\n> > $ cd g\n> > $ git --version\n> > git version 1.6.1.rc4\n> > $ git init\n> > Initialized empty Git repository in /home/bertw/tmp/g/.git/\n> > $ touch file\n> > $ git add file\n> > $ git commit -m init\n> > [master (root-commit)]: created 2155efd: \"init\"\n> >  0 files changed, 0 insertions(+), 0 deletions(-)\n> >  create mode 100644 file\n> > $ tg create t/test1\n> > tg: Automatically marking dependency on master\n> > tg: Creating t/test1 base from master...\n> > Switched to a new branch \"t/test1\"\n> > tg: Topic branch t/test1 set up. Please fill .topmsg now and make\n> > initial commit.\n> > tg: To abort: git rm -f .top* && git checkout master && tg delete t/test1\n> > $ git commit -m \"topic test1\"\n> > [t/test1]: created 3cb4fbf: \"topic test1\"\n> >  2 files changed, 7 insertions(+), 0 deletions(-)\n> >  create mode 100644 .topdeps\n> >  create mode 100644 .topmsg\n> > $ tg create t/test2\n> > tg: Automatically marking dependency on t/test1\n> > tg: Creating t/test2 base from t/test1...\n> > Switched to a new branch \"t/test2\"\n> > tg: Topic branch t/test2 set up. Please fill .topmsg now and make\n> > initial commit.\n> > tg: To abort: git rm -f .top* && git checkout t/test1 && tg delete t/test2\n> > $ git rm -f .top* && git checkout t/test1 && tg delete t/test2\n> > rm '.topdeps'\n> > rm '.topmsg'\n> > D       .topdeps\n> > D       .topmsg\n> > Switched to branch \"t/test1\"\n> > $ git status\n> > # On branch t/test1\n> > # Changes to be committed:\n> > #   (use \"git reset HEAD <file>...\" to unstage)\n> > #\n> > #       deleted:    .topdeps\n> > #       deleted:    .topmsg\n> > #\n> > $\n> Anyone?\nI have git version 1.5.6.5 and for me your recipe[1] ends in\n\n\t$ git status\n\t# On branch t/test1\n\tnothing to commit (working directory clean)\n\nWith git 1.6.1.3 I can reproduce it though.\n\nHere comes a git only test case:\n\n\tgit init\n\ttouch file\n\tgit add file\n\tgit commit -m 'initial commit'\n\tgit checkout -b next\n\techo next > file\n\tgit add file\n\tgit rm -f file\n\tgit checkout master\n\tgit status\n\t\nWhat about the patch below?  It seems git-checkout from 1.6.x merges the\nchanges done to the newly checked out branch.\n\nBest regards\nUwe\n\n[1] I had to use mkdir where you wrote md ;-)\n\nFrom e5b1a979cb22285134c5b7da942984f70a1a3059 Mon Sep 17 00:00:00 2001\nFrom: =?utf-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>\nDate: Fri, 27 Feb 2009 09:22:46 +0100\nSubject: [PATCH] suggest checkout -f to abort the creation of a branch\n\ngit checkout behaves differently for different versions of git (here\n1.5.6.5 and 1.6.1.3) when the index and working copy don't match HEAD.\n\ngit checkout -f does the right thing for both versions.\n\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n---\n tg-create.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/tg-create.sh b/tg-create.sh\nindex 6e84907..45bb79b 100644\n--- a/tg-create.sh\n+++ b/tg-create.sh\n@@ -140,6 +140,6 @@ git add -f \"$root_dir/.topmsg\"\n \n \n info \"Topic branch $name set up. Please fill .topmsg now and make initial commit.\"\n-info \"To abort: git rm -f .top* && git checkout ${deps%% *} && $tg delete $name\"\n+info \"To abort: git checkout -f ${deps%% *} && $tg delete $name\"\n \n # vim:noet\n-- \n1.5.6.5\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"},{"id":"106410","messageId":"36ca99e90902270040g6ae29c69t1d958fda3dfce960@mail.gmail.com","threadId":"17621","inReplyTo":"20090227083211.GA10326@pengutronix.de","subject":"Re: [TopGit] aborting tg create leafs deleted .top* files in index","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2009-02-27T08:40:45Z","receivedAt":"2009-02-27T08:40:45Z","isPatch":false,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Fri, Feb 27, 2009 at 09:32, Uwe Kleine-König\n<u.kleine-koenig@pengutronix.de> wrote:\n> I have git version 1.5.6.5 and for me your recipe[1] ends in\n>\n>        $ git status\n>        # On branch t/test1\n>        nothing to commit (working directory clean)\n>\n> With git 1.6.1.3 I can reproduce it though.\n>\n> Here comes a git only test case:\n>\n>        git init\n>        touch file\n>        git add file\n>        git commit -m 'initial commit'\n>        git checkout -b next\n>        echo next > file\n>        git add file\n>        git rm -f file\n>        git checkout master\n>        git status\n>\n> What about the patch below?  It seems git-checkout from 1.6.x merges the\n> changes done to the newly checked out branch.\nThank you very much. It works here as expected.\n\nBert\n>\n> Best regards\n> Uwe\n"},{"id":"106425","messageId":"20090227105915.GA20932@pengutronix.de","threadId":"17621","inReplyTo":"36ca99e90902270040g6ae29c69t1d958fda3dfce960@mail.gmail.com","subject":"Re: [TopGit] aborting tg create leafs deleted .top* files in index","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-02-27T10:59:15Z","receivedAt":"2009-02-27T10:59:15Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"On Fri, Feb 27, 2009 at 09:40:45AM +0100, Bert Wesarg wrote:\n> On Fri, Feb 27, 2009 at 09:32, Uwe Kleine-König\n> <u.kleine-koenig@pengutronix.de> wrote:\n> > What about the patch below?  It seems git-checkout from 1.6.x merges the\n> > changes done to the newly checked out branch.\n> Thank you very much. It works here as expected.\nAfter some more thought I don't think this is the right fix.  While\nthrowing away changes to .top* looks OK, doing the same for other\nchanges seems not right to me.\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"}]}