git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [StGIT PATCH 0/4] Miscellaneous fixes
@ 2007-08-26 20:26 Karl Hasselström
  2007-08-26 20:26 ` [StGIT PATCH 1/4] Don't use test_expect_failure when more than one thing could fail Karl Hasselström
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Karl Hasselström @ 2007-08-26 20:26 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

This is a few miscellaneous fixes. Also available here:

  git://repo.or.cz/stgit/kha.git fixes

Karl Hasselström (4):
      Don't use test_expect_failure when more than one thing could fail
      Don't write None to the conf file
      Replace "git repo-config" with "git config" in help texts
      Compile regexp just once

 examples/gitconfig          |    2 +-
 stgit/git.py                |    3 ++-
 stgit/stack.py              |    7 ++++---
 t/t2101-pull-policy-pull.sh |    4 ++--
 4 files changed, 9 insertions(+), 7 deletions(-)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [StGIT PATCH 1/4] Don't use test_expect_failure when more than one thing could fail
  2007-08-26 20:26 [StGIT PATCH 0/4] Miscellaneous fixes Karl Hasselström
@ 2007-08-26 20:26 ` Karl Hasselström
  2007-08-26 20:26 ` [StGIT PATCH 2/4] Don't write None to the conf file Karl Hasselström
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Karl Hasselström @ 2007-08-26 20:26 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

It's much better to use ! for the part that you actually expect to
fail; that way, the test will still scream if something _else_ goes
wrong.

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 t/t2101-pull-policy-pull.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t2101-pull-policy-pull.sh b/t/t2101-pull-policy-pull.sh
index 793491c..14d5adb 100755
--- a/t/t2101-pull-policy-pull.sh
+++ b/t/t2101-pull-policy-pull.sh
@@ -39,11 +39,11 @@ test_expect_success \
 # as rewinding, and thus heads/origin is not moved, but the stack
 # is still correctly rebased
 
-test_expect_failure \
+test_expect_success \
     'Rewind/rewrite upstream commit and pull it from clone, without --merged' \
     '
     (cd upstream && echo b >> file2 && stg refresh) &&
-    (cd clone && stg pull)
+    (cd clone && ! stg pull)
     '
 
 test_expect_success \

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [StGIT PATCH 2/4] Don't write None to the conf file
  2007-08-26 20:26 [StGIT PATCH 0/4] Miscellaneous fixes Karl Hasselström
  2007-08-26 20:26 ` [StGIT PATCH 1/4] Don't use test_expect_failure when more than one thing could fail Karl Hasselström
@ 2007-08-26 20:26 ` Karl Hasselström
  2007-08-26 20:26 ` [StGIT PATCH 3/4] Replace "git repo-config" with "git config" in help texts Karl Hasselström
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Karl Hasselström @ 2007-08-26 20:26 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

If we don't have a value for the remote, just don't write it. Writing
None will either write the string "None" or crash StGIT, depending on
how exactly the call is done -- and neither is what we want!

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 stgit/stack.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/stgit/stack.py b/stgit/stack.py
index 030562d..0ce9992 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -546,7 +546,8 @@ class Series(PatchSet):
 
     def set_parent(self, remote, localbranch):
         if localbranch:
-            self.__set_parent_remote(remote)
+            if remote:
+                self.__set_parent_remote(remote)
             self.__set_parent_branch(localbranch)
         # We'll enforce this later
 #         else:

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [StGIT PATCH 3/4] Replace "git repo-config" with "git config" in help texts
  2007-08-26 20:26 [StGIT PATCH 0/4] Miscellaneous fixes Karl Hasselström
  2007-08-26 20:26 ` [StGIT PATCH 1/4] Don't use test_expect_failure when more than one thing could fail Karl Hasselström
  2007-08-26 20:26 ` [StGIT PATCH 2/4] Don't write None to the conf file Karl Hasselström
@ 2007-08-26 20:26 ` Karl Hasselström
  2007-08-26 20:26 ` [StGIT PATCH 4/4] Compile regexp just once Karl Hasselström
  2007-08-29 10:18 ` [StGIT PATCH 0/4] Miscellaneous fixes Catalin Marinas
  4 siblings, 0 replies; 8+ messages in thread
From: Karl Hasselström @ 2007-08-26 20:26 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

It makes sense to still use git-repo-config instead of git-config in
the code, since the latter name is not available in older gits, but
it's better to use the new name in the help texts since the
overwhelming majority of users aren't going to use a very old git.

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 examples/gitconfig |    2 +-
 stgit/stack.py     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/gitconfig b/examples/gitconfig
index e402208..f1c653e 100644
--- a/examples/gitconfig
+++ b/examples/gitconfig
@@ -1,6 +1,6 @@
 # StGIT configuration file. Copy it to any of ~/.gitconfig or
 # .git/config and modify as needed. Note that the latter overrides
-# the former. The "git repo-config" command can be used as well
+# the former. The "git config" command can be used as well
 
 [user]
 	# Default author/committer details (standard GIT variables)
diff --git a/stgit/stack.py b/stgit/stack.py
index 0ce9992..1ab10c5 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -515,7 +515,7 @@ class Series(PatchSet):
             out.note(('No parent remote declared for stack "%s",'
                       ' defaulting to "origin".' % self.get_name()),
                      ('Consider setting "branch.%s.remote" and'
-                      ' "branch.%s.merge" with "git repo-config".'
+                      ' "branch.%s.merge" with "git config".'
                       % (self.get_name(), self.get_name())))
             return 'origin'
         else:
@@ -532,7 +532,7 @@ class Series(PatchSet):
             out.note(('No parent branch declared for stack "%s",'
                       ' defaulting to "heads/origin".' % self.get_name()),
                      ('Consider setting "branch.%s.stgit.parentbranch"'
-                      ' with "git repo-config".' % self.get_name()))
+                      ' with "git config".' % self.get_name()))
             return 'heads/origin'
         else:
             raise StackException, 'Cannot find a parent branch for "%s"' % self.get_name()

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [StGIT PATCH 4/4] Compile regexp just once
  2007-08-26 20:26 [StGIT PATCH 0/4] Miscellaneous fixes Karl Hasselström
                   ` (2 preceding siblings ...)
  2007-08-26 20:26 ` [StGIT PATCH 3/4] Replace "git repo-config" with "git config" in help texts Karl Hasselström
@ 2007-08-26 20:26 ` Karl Hasselström
  2007-08-29 10:18 ` [StGIT PATCH 0/4] Miscellaneous fixes Catalin Marinas
  4 siblings, 0 replies; 8+ messages in thread
From: Karl Hasselström @ 2007-08-26 20:26 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

It's a waste of time to recompile the same regexp every time we go
through the loop.

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 stgit/git.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/stgit/git.py b/stgit/git.py
index 1807f69..14b4c81 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -275,8 +275,9 @@ def local_changes(verbose = True):
 
 def get_heads():
     heads = []
+    hr = re.compile(r'^[0-9a-f]{40} refs/heads/(.+)$')
     for line in _output_lines(['git-show-ref', '--heads']):
-        m = re.match('^[0-9a-f]{40} refs/heads/(.+)$', line)
+        m = hr.match(line)
         heads.append(m.group(1))
     return heads
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [StGIT PATCH 0/4] Miscellaneous fixes
  2007-08-26 20:26 [StGIT PATCH 0/4] Miscellaneous fixes Karl Hasselström
                   ` (3 preceding siblings ...)
  2007-08-26 20:26 ` [StGIT PATCH 4/4] Compile regexp just once Karl Hasselström
@ 2007-08-29 10:18 ` Catalin Marinas
  2007-08-29 11:17   ` Karl Hasselström
  4 siblings, 1 reply; 8+ messages in thread
From: Catalin Marinas @ 2007-08-29 10:18 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: git

On 26/08/2007, Karl Hasselström <kha@treskal.com> wrote:
> This is a few miscellaneous fixes. Also available here:

Thanks.

>
>   git://repo.or.cz/stgit/kha.git fixes
>
> Karl Hasselström (4):
>       Don't use test_expect_failure when more than one thing could fail
>       Don't write None to the conf file
>       Replace "git repo-config" with "git config" in help texts
>       Compile regexp just once
>
>  examples/gitconfig          |    2 +-
>  stgit/git.py                |    3 ++-
>  stgit/stack.py              |    7 ++++---
>  t/t2101-pull-policy-pull.sh |    4 ++--
>  4 files changed, 9 insertions(+), 7 deletions(-)

BTW, did you generate the above text by hand and copied it to the
e-mail? People asked in the past for this kind of text to be
automatically generated by 'stg mail'.

-- 
Catalin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [StGIT PATCH 0/4] Miscellaneous fixes
  2007-08-29 10:18 ` [StGIT PATCH 0/4] Miscellaneous fixes Catalin Marinas
@ 2007-08-29 11:17   ` Karl Hasselström
  2007-09-03  8:40     ` Catalin Marinas
  0 siblings, 1 reply; 8+ messages in thread
From: Karl Hasselström @ 2007-08-29 11:17 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

On 2007-08-29 11:18:34 +0100, Catalin Marinas wrote:

> On 26/08/2007, Karl Hasselström <kha@treskal.com> wrote:
>
> >   git://repo.or.cz/stgit/kha.git fixes
> >
> > Karl Hasselström (4):
> >       Don't use test_expect_failure when more than one thing could fail
> >       Don't write None to the conf file
> >       Replace "git repo-config" with "git config" in help texts
> >       Compile regexp just once
> >
> >  examples/gitconfig          |    2 +-
> >  stgit/git.py                |    3 ++-
> >  stgit/stack.py              |    7 ++++---
> >  t/t2101-pull-policy-pull.sh |    4 ++--
> >  4 files changed, 9 insertions(+), 7 deletions(-)
>
> BTW, did you generate the above text by hand and copied it to the
> e-mail?

Yes. It's the output of git-request-pull.

> People asked in the past for this kind of text to be automatically
> generated by 'stg mail'.

I might very well have been one of them.

Adding cover message template support for shortlog and aggregate
diffstat should be straightforward. I might get to it some time in the
not too distant future if no one else beats me to it. As for the pull
line, that's another story; git-request-pull actually seems to connect
to that repository and check its contents, and I'm not convinced
that's a good thing for stg-mail to be doing. But that's the least
wanted item of the three anyway, I guess.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [StGIT PATCH 0/4] Miscellaneous fixes
  2007-08-29 11:17   ` Karl Hasselström
@ 2007-09-03  8:40     ` Catalin Marinas
  0 siblings, 0 replies; 8+ messages in thread
From: Catalin Marinas @ 2007-09-03  8:40 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: git

On 29/08/07, Karl Hasselström <kha@treskal.com> wrote:
> On 2007-08-29 11:18:34 +0100, Catalin Marinas wrote:
>
> > On 26/08/2007, Karl Hasselström <kha@treskal.com> wrote:
> > >  examples/gitconfig          |    2 +-
> > >  stgit/git.py                |    3 ++-
> > >  stgit/stack.py              |    7 ++++---
> > >  t/t2101-pull-policy-pull.sh |    4 ++--
> > >  4 files changed, 9 insertions(+), 7 deletions(-)
> >
> > BTW, did you generate the above text by hand and copied it to the
> > e-mail?
>
> Yes. It's the output of git-request-pull.
>
> > People asked in the past for this kind of text to be automatically
> > generated by 'stg mail'.
>
> I might very well have been one of them.

On a related note, it might make sense for 'stg export' to add (with
an additional option) a comment line beside each patch in the series
file containing the short description.

-- 
Catalin

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-09-03  8:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-26 20:26 [StGIT PATCH 0/4] Miscellaneous fixes Karl Hasselström
2007-08-26 20:26 ` [StGIT PATCH 1/4] Don't use test_expect_failure when more than one thing could fail Karl Hasselström
2007-08-26 20:26 ` [StGIT PATCH 2/4] Don't write None to the conf file Karl Hasselström
2007-08-26 20:26 ` [StGIT PATCH 3/4] Replace "git repo-config" with "git config" in help texts Karl Hasselström
2007-08-26 20:26 ` [StGIT PATCH 4/4] Compile regexp just once Karl Hasselström
2007-08-29 10:18 ` [StGIT PATCH 0/4] Miscellaneous fixes Catalin Marinas
2007-08-29 11:17   ` Karl Hasselström
2007-09-03  8:40     ` Catalin Marinas

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).