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

Re: [PATCH] stgit: Handle 'A' flag for new files

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Jul 28, 2005, 12:20 UTC
Message-ID
<tnxwtnbunov.fsf@arm.com>
In-Reply-To
<m3d5p3kuv1.fsf@telia.com>
Peter Osterlund <petero2@telia.com> wrote:
> Patches that add new files don't work correctly if git reports them
> with the 'A' flag. StGIT claims there are unresolved conflicts. This
> patch fixes it.
Thanks. Applied (together with the one below).
diff --git a/stgit/git.py b/stgit/git.py
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -292,7 +292,7 @@ def commit(message, files = [], parents
         rm_files=[]
         m_files=[]
         for f in cache_files:
-            if f[0] == 'N':
+            if f[0] in ['N', 'A']:
                 add_files.append(f[1])
             elif f[0] == 'D':
                 rm_files.append(f[1])
@@ -437,7 +437,8 @@ def checkout(files = [], force = False):
 def switch(tree_id):
     """Switch the tree to the given id
     """
-    to_delete = filter(lambda x: x[0] == 'N', __tree_status(tree_id = tree_id))+    to_delete = filter(lambda x: x[0] in ['N', 'A'],
+                       __tree_status(tree_id = tree_id))

     if __run('git-read-tree -m', [tree_id]) != 0:
         raise GitException, 'Failed git-read-tree -m %s' % tree_id
-- 
Catalin
Previous: Peter Osterlund
Message 2 of 2 in “stgit: Handle 'A' flag for new files”
  1. stgit: Handle 'A' flag for new filesPeter Osterlund, Jul 28, 2005
  2. Catalin MarinasJul 28, 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.