* [TopGit] aborting tg create leafs deleted .top* files in index
@ 2009-02-06 19:03 Bert Wesarg
2009-02-27 6:47 ` Bert Wesarg
0 siblings, 1 reply; 5+ messages in thread
From: Bert Wesarg @ 2009-02-06 19:03 UTC (permalink / raw)
To: Petr Baudis; +Cc: Git Mailing List, martin f krafft
Hi,
after executing the abort commands to remove a just created new topic
branch, the .top* files from the previous branch are markes as
deleted.
To reproduce:
$ md g
$ cd g
$ git --version
git version 1.6.1.rc4
$ git init
Initialized empty Git repository in /home/bertw/tmp/g/.git/
$ touch file
$ git add file
$ git commit -m init
[master (root-commit)]: created 2155efd: "init"
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 file
$ tg create t/test1
tg: Automatically marking dependency on master
tg: Creating t/test1 base from master...
Switched to a new branch "t/test1"
tg: Topic branch t/test1 set up. Please fill .topmsg now and make
initial commit.
tg: To abort: git rm -f .top* && git checkout master && tg delete t/test1
$ git commit -m "topic test1"
[t/test1]: created 3cb4fbf: "topic test1"
2 files changed, 7 insertions(+), 0 deletions(-)
create mode 100644 .topdeps
create mode 100644 .topmsg
$ tg create t/test2
tg: Automatically marking dependency on t/test1
tg: Creating t/test2 base from t/test1...
Switched to a new branch "t/test2"
tg: Topic branch t/test2 set up. Please fill .topmsg now and make
initial commit.
tg: To abort: git rm -f .top* && git checkout t/test1 && tg delete t/test2
$ git rm -f .top* && git checkout t/test1 && tg delete t/test2
rm '.topdeps'
rm '.topmsg'
D .topdeps
D .topmsg
Switched to branch "t/test1"
$ git status
# On branch t/test1
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: .topdeps
# deleted: .topmsg
#
$
Regards,
Bert Wesarg
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [TopGit] aborting tg create leafs deleted .top* files in index
2009-02-06 19:03 [TopGit] aborting tg create leafs deleted .top* files in index Bert Wesarg
@ 2009-02-27 6:47 ` Bert Wesarg
2009-02-27 8:32 ` Uwe Kleine-König
0 siblings, 1 reply; 5+ messages in thread
From: Bert Wesarg @ 2009-02-27 6:47 UTC (permalink / raw)
To: Petr Baudis; +Cc: Git Mailing List, martin f krafft, Uwe Kleine-König
On Fri, Feb 6, 2009 at 20:03, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> Hi,
>
> after executing the abort commands to remove a just created new topic
> branch, the .top* files from the previous branch are markes as
> deleted.
>
> To reproduce:
>
> $ md g
> $ cd g
> $ git --version
> git version 1.6.1.rc4
> $ git init
> Initialized empty Git repository in /home/bertw/tmp/g/.git/
> $ touch file
> $ git add file
> $ git commit -m init
> [master (root-commit)]: created 2155efd: "init"
> 0 files changed, 0 insertions(+), 0 deletions(-)
> create mode 100644 file
> $ tg create t/test1
> tg: Automatically marking dependency on master
> tg: Creating t/test1 base from master...
> Switched to a new branch "t/test1"
> tg: Topic branch t/test1 set up. Please fill .topmsg now and make
> initial commit.
> tg: To abort: git rm -f .top* && git checkout master && tg delete t/test1
> $ git commit -m "topic test1"
> [t/test1]: created 3cb4fbf: "topic test1"
> 2 files changed, 7 insertions(+), 0 deletions(-)
> create mode 100644 .topdeps
> create mode 100644 .topmsg
> $ tg create t/test2
> tg: Automatically marking dependency on t/test1
> tg: Creating t/test2 base from t/test1...
> Switched to a new branch "t/test2"
> tg: Topic branch t/test2 set up. Please fill .topmsg now and make
> initial commit.
> tg: To abort: git rm -f .top* && git checkout t/test1 && tg delete t/test2
> $ git rm -f .top* && git checkout t/test1 && tg delete t/test2
> rm '.topdeps'
> rm '.topmsg'
> D .topdeps
> D .topmsg
> Switched to branch "t/test1"
> $ git status
> # On branch t/test1
> # Changes to be committed:
> # (use "git reset HEAD <file>..." to unstage)
> #
> # deleted: .topdeps
> # deleted: .topmsg
> #
> $
Anyone?
>
>
> Regards,
> Bert Wesarg
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [TopGit] aborting tg create leafs deleted .top* files in index
2009-02-27 6:47 ` Bert Wesarg
@ 2009-02-27 8:32 ` Uwe Kleine-König
2009-02-27 8:40 ` Bert Wesarg
0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2009-02-27 8:32 UTC (permalink / raw)
To: Bert Wesarg; +Cc: Petr Baudis, Git Mailing List, martin f krafft
Hi Bert,
On Fri, Feb 27, 2009 at 07:47:15AM +0100, Bert Wesarg wrote:
> On Fri, Feb 6, 2009 at 20:03, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > Hi,
> >
> > after executing the abort commands to remove a just created new topic
> > branch, the .top* files from the previous branch are markes as
> > deleted.
> >
> > To reproduce:
> >
> > $ md g
> > $ cd g
> > $ git --version
> > git version 1.6.1.rc4
> > $ git init
> > Initialized empty Git repository in /home/bertw/tmp/g/.git/
> > $ touch file
> > $ git add file
> > $ git commit -m init
> > [master (root-commit)]: created 2155efd: "init"
> > 0 files changed, 0 insertions(+), 0 deletions(-)
> > create mode 100644 file
> > $ tg create t/test1
> > tg: Automatically marking dependency on master
> > tg: Creating t/test1 base from master...
> > Switched to a new branch "t/test1"
> > tg: Topic branch t/test1 set up. Please fill .topmsg now and make
> > initial commit.
> > tg: To abort: git rm -f .top* && git checkout master && tg delete t/test1
> > $ git commit -m "topic test1"
> > [t/test1]: created 3cb4fbf: "topic test1"
> > 2 files changed, 7 insertions(+), 0 deletions(-)
> > create mode 100644 .topdeps
> > create mode 100644 .topmsg
> > $ tg create t/test2
> > tg: Automatically marking dependency on t/test1
> > tg: Creating t/test2 base from t/test1...
> > Switched to a new branch "t/test2"
> > tg: Topic branch t/test2 set up. Please fill .topmsg now and make
> > initial commit.
> > tg: To abort: git rm -f .top* && git checkout t/test1 && tg delete t/test2
> > $ git rm -f .top* && git checkout t/test1 && tg delete t/test2
> > rm '.topdeps'
> > rm '.topmsg'
> > D .topdeps
> > D .topmsg
> > Switched to branch "t/test1"
> > $ git status
> > # On branch t/test1
> > # Changes to be committed:
> > # (use "git reset HEAD <file>..." to unstage)
> > #
> > # deleted: .topdeps
> > # deleted: .topmsg
> > #
> > $
> Anyone?
I have git version 1.5.6.5 and for me your recipe[1] ends in
$ git status
# On branch t/test1
nothing to commit (working directory clean)
With git 1.6.1.3 I can reproduce it though.
Here comes a git only test case:
git init
touch file
git add file
git commit -m 'initial commit'
git checkout -b next
echo next > file
git add file
git rm -f file
git checkout master
git status
What about the patch below? It seems git-checkout from 1.6.x merges the
changes done to the newly checked out branch.
Best regards
Uwe
[1] I had to use mkdir where you wrote md ;-)
From e5b1a979cb22285134c5b7da942984f70a1a3059 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Date: Fri, 27 Feb 2009 09:22:46 +0100
Subject: [PATCH] suggest checkout -f to abort the creation of a branch
git checkout behaves differently for different versions of git (here
1.5.6.5 and 1.6.1.3) when the index and working copy don't match HEAD.
git checkout -f does the right thing for both versions.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
tg-create.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tg-create.sh b/tg-create.sh
index 6e84907..45bb79b 100644
--- a/tg-create.sh
+++ b/tg-create.sh
@@ -140,6 +140,6 @@ git add -f "$root_dir/.topmsg"
info "Topic branch $name set up. Please fill .topmsg now and make initial commit."
-info "To abort: git rm -f .top* && git checkout ${deps%% *} && $tg delete $name"
+info "To abort: git checkout -f ${deps%% *} && $tg delete $name"
# vim:noet
--
1.5.6.5
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [TopGit] aborting tg create leafs deleted .top* files in index
2009-02-27 8:32 ` Uwe Kleine-König
@ 2009-02-27 8:40 ` Bert Wesarg
2009-02-27 10:59 ` Uwe Kleine-König
0 siblings, 1 reply; 5+ messages in thread
From: Bert Wesarg @ 2009-02-27 8:40 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Petr Baudis, Git Mailing List, martin f krafft
On Fri, Feb 27, 2009 at 09:32, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> I have git version 1.5.6.5 and for me your recipe[1] ends in
>
> $ git status
> # On branch t/test1
> nothing to commit (working directory clean)
>
> With git 1.6.1.3 I can reproduce it though.
>
> Here comes a git only test case:
>
> git init
> touch file
> git add file
> git commit -m 'initial commit'
> git checkout -b next
> echo next > file
> git add file
> git rm -f file
> git checkout master
> git status
>
> What about the patch below? It seems git-checkout from 1.6.x merges the
> changes done to the newly checked out branch.
Thank you very much. It works here as expected.
Bert
>
> Best regards
> Uwe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [TopGit] aborting tg create leafs deleted .top* files in index
2009-02-27 8:40 ` Bert Wesarg
@ 2009-02-27 10:59 ` Uwe Kleine-König
0 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2009-02-27 10:59 UTC (permalink / raw)
To: Bert Wesarg; +Cc: Petr Baudis, Git Mailing List, martin f krafft
On Fri, Feb 27, 2009 at 09:40:45AM +0100, Bert Wesarg wrote:
> On Fri, Feb 27, 2009 at 09:32, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > What about the patch below? It seems git-checkout from 1.6.x merges the
> > changes done to the newly checked out branch.
> Thank you very much. It works here as expected.
After some more thought I don't think this is the right fix. While
throwing away changes to .top* looks OK, doing the same for other
changes seems not right to me.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-02-27 11:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06 19:03 [TopGit] aborting tg create leafs deleted .top* files in index Bert Wesarg
2009-02-27 6:47 ` Bert Wesarg
2009-02-27 8:32 ` Uwe Kleine-König
2009-02-27 8:40 ` Bert Wesarg
2009-02-27 10:59 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).