* stgit and rm a file
@ 2008-08-01 2:02 Jon Smirl
2008-08-04 13:41 ` [StGit PATCH] Add some tests of refreshing removed files Karl Hasselström
0 siblings, 1 reply; 5+ messages in thread
From: Jon Smirl @ 2008-08-01 2:02 UTC (permalink / raw)
To: Git Mailing List
Make a new patch, git rm a file, refresh. It won't pick up the rm. Do
something else besides just a rm and it will pick up the rm. Is it
already fixed in the much anticipated refresh rewrite?
jonsmirl@terra:~/fs$ stg --version
Stacked GIT 0.14.3.173.g2e37
git version 1.6.0.rc0
Python version 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]
jonsmirl@terra:~/fs$
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [StGit PATCH] Add some tests of refreshing removed files
2008-08-01 2:02 stgit and rm a file Jon Smirl
@ 2008-08-04 13:41 ` Karl Hasselström
2008-08-04 14:07 ` Jon Smirl
0 siblings, 1 reply; 5+ messages in thread
From: Karl Hasselström @ 2008-08-04 13:41 UTC (permalink / raw)
To: Jon Smirl; +Cc: git, Catalin Marinas
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
These four tests all pass on Catalin's current master. Do they fail
for you, or did I miss something in your problem description?
t/t2702-refresh-rm.sh | 101 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 101 insertions(+), 0 deletions(-)
create mode 100755 t/t2702-refresh-rm.sh
diff --git a/t/t2702-refresh-rm.sh b/t/t2702-refresh-rm.sh
new file mode 100755
index 0000000..896ebf3
--- /dev/null
+++ b/t/t2702-refresh-rm.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+test_description='"stg refresh" with removed files'
+
+. ./test-lib.sh
+
+# Ignore our own temp files.
+cat >> .git/info/exclude <<EOF
+expected*.txt
+files*.txt
+status*.txt
+EOF
+
+reset () {
+ stg pop -a > /dev/null
+ git reset --hard > /dev/null
+}
+
+test_expect_success 'Initialize StGit stack' '
+ stg init &&
+ echo x > x.txt &&
+ echo y > y.txt &&
+ git add x.txt y.txt &&
+ git commit -m "Add some files"
+'
+
+cat > expected0.txt <<EOF
+D y.txt
+EOF
+printf '' > expected1.txt
+test_expect_success 'git-rm a file' '
+ stg new -m p0 &&
+ git rm y.txt &&
+ stg status > status0.txt &&
+ test_cmp expected0.txt status0.txt &&
+ stg refresh &&
+ stg status > status1.txt &&
+ test_cmp expected1.txt status1.txt &&
+ stg files | sort > files.txt &&
+ test_cmp expected0.txt files.txt
+'
+
+reset
+
+cat > expected0.txt <<EOF
+D y.txt
+M x.txt
+EOF
+printf '' > expected1.txt
+test_expect_success 'git-rm a file together with other changes' '
+ stg new -m p1 &&
+ echo x2 >> x.txt &&
+ git rm y.txt &&
+ stg status > status0.txt &&
+ test_cmp expected0.txt status0.txt &&
+ stg refresh &&
+ stg status > status1.txt &&
+ test_cmp expected1.txt status1.txt &&
+ stg files | sort > files.txt &&
+ test_cmp expected0.txt files.txt
+'
+
+reset
+
+cat > expected0.txt <<EOF
+D y.txt
+EOF
+printf '' > expected1.txt
+test_expect_success 'rm a file' '
+ stg new -m p2 &&
+ rm y.txt &&
+ stg status > status0.txt &&
+ test_cmp expected0.txt status0.txt &&
+ stg refresh &&
+ stg status > status1.txt &&
+ test_cmp expected1.txt status1.txt &&
+ stg files | sort > files.txt &&
+ test_cmp expected0.txt files.txt
+'
+
+reset
+
+cat > expected0.txt <<EOF
+D y.txt
+M x.txt
+EOF
+printf '' > expected1.txt
+test_expect_success 'rm a file together with other changes' '
+ stg new -m p3 &&
+ echo x2 >> x.txt &&
+ rm y.txt &&
+ stg status > status0.txt &&
+ test_cmp expected0.txt status0.txt &&
+ stg refresh &&
+ stg status > status1.txt &&
+ test_cmp expected1.txt status1.txt &&
+ stg files | sort > files.txt &&
+ test_cmp expected0.txt files.txt
+'
+
+test_done
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [StGit PATCH] Add some tests of refreshing removed files
2008-08-04 13:41 ` [StGit PATCH] Add some tests of refreshing removed files Karl Hasselström
@ 2008-08-04 14:07 ` Jon Smirl
2008-08-04 14:08 ` Jon Smirl
2008-08-04 14:43 ` Karl Hasselström
0 siblings, 2 replies; 5+ messages in thread
From: Jon Smirl @ 2008-08-04 14:07 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git, Catalin Marinas
On 8/4/08, Karl Hasselström <kha@treskal.com> wrote:
> Signed-off-by: Karl Hasselström <kha@treskal.com>
>
> ---
>
> These four tests all pass on Catalin's current master. Do they fail
> for you, or did I miss something in your problem description?
I just updated to current git and stg and retested. Tracking a remove
is working now for me. Tools were about three months old before
updating.
Not sure what changed. But I definitely couldn't get stgit to do it
and had to use git commands to generate the patch. I would remove the
file, refresh and the patch was empty.
stg status would show the file in D state. As soon as I touched
something else and refreshed the rm would appear in the patch.
Maybe there is more to the triggering sequence than a simple rm. I'll
keep a watch out and see if I can figure out how I got into the state.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [StGit PATCH] Add some tests of refreshing removed files
2008-08-04 14:07 ` Jon Smirl
@ 2008-08-04 14:08 ` Jon Smirl
2008-08-04 14:43 ` Karl Hasselström
1 sibling, 0 replies; 5+ messages in thread
From: Jon Smirl @ 2008-08-04 14:08 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git, Catalin Marinas
On 8/4/08, Jon Smirl <jonsmirl@gmail.com> wrote:
> On 8/4/08, Karl Hasselström <kha@treskal.com> wrote:
> > Signed-off-by: Karl Hasselström <kha@treskal.com>
> >
> > ---
> >
> > These four tests all pass on Catalin's current master. Do they fail
> > for you, or did I miss something in your problem description?
>
>
> I just updated to current git and stg and retested. Tracking a remove
> is working now for me. Tools were about three months old before
> updating.
>
> Not sure what changed. But I definitely couldn't get stgit to do it
> and had to use git commands to generate the patch. I would remove the
> file, refresh and the patch was empty.
> stg status would show the file in D state. As soon as I touched
> something else and refreshed the rm would appear in the patch.
The file I was trying to rm was a hidden file, .mailmap
>
> Maybe there is more to the triggering sequence than a simple rm. I'll
> keep a watch out and see if I can figure out how I got into the state.
>
>
> --
> Jon Smirl
> jonsmirl@gmail.com
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [StGit PATCH] Add some tests of refreshing removed files
2008-08-04 14:07 ` Jon Smirl
2008-08-04 14:08 ` Jon Smirl
@ 2008-08-04 14:43 ` Karl Hasselström
1 sibling, 0 replies; 5+ messages in thread
From: Karl Hasselström @ 2008-08-04 14:43 UTC (permalink / raw)
To: Jon Smirl; +Cc: git, Catalin Marinas
On 2008-08-04 10:07:45 -0400, Jon Smirl wrote:
> I just updated to current git and stg and retested. Tracking a
> remove is working now for me.
Well, that's good.
> Tools were about three months old before updating.
Might have been fixed by 8fe07fa4cef (Handle refresh of changed files
with non-ASCII names) or 466bfe50 (Fix "refresh" failure with moved
files (bug 11661)).
> Not sure what changed. But I definitely couldn't get stgit to do it
> and had to use git commands to generate the patch. I would remove
> the file, refresh and the patch was empty. stg status would show the
> file in D state. As soon as I touched something else and refreshed
> the rm would appear in the patch.
Well, that's exactly what my new test tests for. So at least i got it
right.
> Maybe there is more to the triggering sequence than a simple rm.
> I'll keep a watch out and see if I can figure out how I got into the
> state.
Thanks.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-08-04 14:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-01 2:02 stgit and rm a file Jon Smirl
2008-08-04 13:41 ` [StGit PATCH] Add some tests of refreshing removed files Karl Hasselström
2008-08-04 14:07 ` Jon Smirl
2008-08-04 14:08 ` Jon Smirl
2008-08-04 14:43 ` Karl Hasselström
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).