From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [PATCH] Stgit - gitmergeonefile.py: handle removal vs. changes
Date: Sun, 13 Nov 2005 20:42:25 +0100 [thread overview]
Message-ID: <20051113194225.20447.57910.stgit@zion.home.lan> (raw)
I just got a "removal vs. changed" conflict, which is unhandled by StGit. That
is taken from git-merge-one-file resolver, but is bad, as stg resolved does not
handle unmerged entries (and probably it should be fixed too).
Sample patch included, but some thought must be done on it (see the comments I
left in).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
gitmergeonefile.py | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/gitmergeonefile.py b/gitmergeonefile.py
index 1cba193..9344d33 100755
--- a/gitmergeonefile.py
+++ b/gitmergeonefile.py
@@ -180,6 +180,30 @@ if orig_hash:
os.remove(path)
__remove_files()
sys.exit(os.system('git-update-index --remove -- %s' % path))
+ # file deleted in one and changed in the other
+ else:
+ # Do something here - we must at least merge the entry in the cache,
+ # instead of leaving it in U(nmerged) state. In fact, stg resolved
+ # does not handle that.
+
+ # Do the same thing cogito does - remove the file in any case.
+ os.system('git-update-index --remove -- %s' % path)
+
+ #if file1_hash:
+ ## file deleted upstream and changed in the patch. The patch is
+ ## probably going to move the changes elsewhere.
+
+ #os.system('git-update-index --remove -- %s' % path)
+ #else:
+ ## file deleted in the patch and changed upstream. We could re-delete
+ ## it, but for now leave it there - and let the user check if he
+ ## still wants to remove the file.
+
+ ## reset the cache to the first branch
+ #os.system('git-update-index --cacheinfo %s %s %s'
+ #% (file1_mode, file1_hash, path))
+ __conflict()
+
# file does not exist in origin
else:
# file added in both
next reply other threads:[~2005-11-13 19:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-13 19:42 Paolo 'Blaisorblade' Giarrusso [this message]
2005-11-15 9:54 ` [PATCH] Stgit - gitmergeonefile.py: handle removal vs. changes Catalin Marinas
2005-11-16 14:44 ` Blaisorblade
2005-11-17 22:10 ` Catalin Marinas
2005-11-17 22:50 ` Chuck Lever
2005-11-21 21:32 ` Catalin Marinas
2005-12-30 17:59 ` Blaisorblade
2006-01-07 11:23 ` Catalin Marinas
2006-01-08 1:50 ` Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051113194225.20447.57910.stgit@zion.home.lan \
--to=blaisorblade@yahoo.it \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).