git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fast-forwarding does a git.switch() even when it forwarded no patches

From
CLChuck Lever <cel@netapp.com>
Date
Dec 2, 2005, 00:15 UTC
Message-ID
<20051202001513.9140.14792.stgit@dexter.citi.umich.edu>
In-Reply-To
<20051202001141.9140.23252.stgit@dexter.citi.umich.edu>

The git.switch() in forward_patches() is not needed when no patches have been fast forwarded. This is a significant speed up.

Signed-off-by: Chuck Lever <cel@netapp.com>
---
 stgit/stack.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/stgit/stack.py b/stgit/stack.py
index 3fd6a46..3cc37c5 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -735,6 +735,9 @@ class Series:
             forwarded+=1
             unapplied.remove(name)
 
+        if forwarded == 0:
+            return 0
+
         git.switch(top)
 
         append_strings(self.__applied_file, names[0:forwarded])
Previous: Chuck Lever
Message 2 of 2 in “unneeded processing in forward_patches() ??”
  1. unneeded processing in forward_patches() ??Chuck Lever, Dec 2, 2005
  2. Fast-forwarding does a git.switch() even when it forwarded no patchesChuck Lever, Dec 2, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.