git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Catalin Marinas <catalin.marinas@gmail.com>
To: git@vger.kernel.org, "Karl Hasselström" <kha@treskal.com>
Subject: [StGit PATCH] Remove the resolved command
Date: Fri, 29 May 2009 22:30:13 +0100	[thread overview]
Message-ID: <20090529213013.8908.45041.stgit@localhost.localdomain> (raw)

From: Catalin Marinas <catalin.marinas@arm.com>

This command simply duplicates the "git add" or "git mergetool" commands
for handling conflicts.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
 Documentation/tutorial.txt |    2 +
 examples/gitconfig         |    4 --
 stgit/commands/common.py   |    2 +
 stgit/commands/push.py     |    4 +-
 stgit/commands/rebase.py   |    2 +
 stgit/commands/resolved.py |   82 --------------------------------------------
 stgit/config.py            |    1 -
 t/t0002-status.sh          |    2 +
 t/t2000-sync.sh            |    4 +-
 9 files changed, 8 insertions(+), 95 deletions(-)
 delete mode 100644 stgit/commands/resolved.py

diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index 8e0adbf..4aa7629 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -313,7 +313,7 @@ markers.
 Now that we've resolved the conflict, we just need to tell StGit about
 it:
 
-  $ stg resolved TODO
+  $ git add TODO
   $ stg status
   M TODO
 
diff --git a/examples/gitconfig b/examples/gitconfig
index e235e14..4f56918 100644
--- a/examples/gitconfig
+++ b/examples/gitconfig
@@ -17,10 +17,6 @@
 	# Automatically sign newly created patches
 	#autosign = Signed-off-by
 
-	# Set to 'yes' if you don't want to use the 'resolved' command.
-	# 'refresh' will automatically mark the conflicts as resolved
-	#autoresolved = no
-
 	# SMTP server for sending patches
 	#smtpserver = /usr/sbin/sendmail -t -i
 	#smtpserver = localhost:25
diff --git a/stgit/commands/common.py b/stgit/commands/common.py
index 1bc162f..bc8266e 100644
--- a/stgit/commands/common.py
+++ b/stgit/commands/common.py
@@ -120,7 +120,7 @@ def check_head_top_equal(crt_series):
 def check_conflicts():
     if git.get_conflicts():
         raise CmdException('Unsolved conflicts. Please fix the conflicts'
-                           ' then use "resolve <files>" or revert the'
+                           ' then use "git add --update <files>" or revert the'
                            ' changes with "status --reset".')
 
 def print_crt_patch(crt_series, branch = None):
diff --git a/stgit/commands/push.py b/stgit/commands/push.py
index 84a93bd..d5e02e0 100644
--- a/stgit/commands/push.py
+++ b/stgit/commands/push.py
@@ -30,8 +30,8 @@ the stack. The 'push' operation allows patch reordering by commuting
 them with the three-way merge algorithm. If there are conflicts while
 pushing a patch, those conflicts are written to the work tree, and the
 command halts. Conflicts raised during the push operation have to be
-fixed and the 'resolved' command run (alternatively, you may undo the
-conflicting push with 'stg undo').
+fixed and the 'git add --update' command run (alternatively, you may
+undo the conflicting push with 'stg undo').
 
 The command also notifies when the patch becomes empty (fully merged
 upstream) or is modified (three-way merged) by the 'push' operation."""
diff --git a/stgit/commands/rebase.py b/stgit/commands/rebase.py
index a4bc6e7..b949a5c 100644
--- a/stgit/commands/rebase.py
+++ b/stgit/commands/rebase.py
@@ -31,7 +31,7 @@ Pop all patches from current stack, move the stack base to the given
 If you experience merge conflicts, resolve the problem and continue
 the rebase by executing the following sequence:
 
-        $ stg resolved -a [-i]
+        $ git add --update
         $ stg refresh
         $ stg goto top-patch
 
diff --git a/stgit/commands/resolved.py b/stgit/commands/resolved.py
deleted file mode 100644
index eba778d..0000000
--- a/stgit/commands/resolved.py
+++ /dev/null
@@ -1,82 +0,0 @@
-
-__copyright__ = """
-Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 2 as
-published by the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""
-
-import sys, os
-from stgit.argparse import opt
-from stgit.commands.common import *
-from stgit.utils import *
-from stgit import argparse, stack, git, basedir
-from stgit.config import config, file_extensions
-
-help = 'Mark a file conflict as solved'
-kind = 'wc'
-usage = ['[options] [<files...>]']
-description = """
-Mark a merge conflict as resolved. The conflicts can be seen with the
-'status' command, the corresponding files being prefixed with a
-'C'."""
-
-args = [argparse.conflicting_files]
-options = [
-    opt('-a', '--all', action = 'store_true',
-        short = 'Mark all conflicts as solved'),
-    opt('-r', '--reset', metavar = '(ancestor|current|patched)',
-        args = [argparse.strings('ancestor', 'current', 'patched')],
-        short = 'Reset the file(s) to the given state'),
-    opt('-i', '--interactive', action = 'store_true',
-        short = 'Run the interactive merging tool')]
-
-directory = DirectoryHasRepository(needs_current_series = False, log = False)
-
-def func(parser, options, args):
-    """Mark the conflict as resolved
-    """
-    args = git.ls_files(args)
-    directory.cd_to_topdir()
-
-    if options.reset \
-           and options.reset not in file_extensions():
-        raise CmdException, 'Unknown reset state: %s' % options.reset
-
-    if options.all and not options.interactive:
-        resolved_all(options.reset)
-        return
-
-    conflicts = git.get_conflicts()
-
-    if len(args) != 0:
-        files = args
-    elif options.all:
-        files = conflicts
-    else:
-        parser.error('incorrect number of arguments')
-
-    if not conflicts:
-        raise CmdException, 'No more conflicts'
-
-    # check for arguments validity
-    if not options.all:
-        for filename in files:
-            if not filename in conflicts:
-                raise CmdException, 'No conflicts for "%s"' % filename
-
-    # resolved
-    if options.interactive:
-        git.mergetool(files)
-    else:
-        git.resolved(files, options.reset)
diff --git a/stgit/config.py b/stgit/config.py
index a98c303..a3dbfa5 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -28,7 +28,6 @@ class GitConfigException(StgException):
 
 class GitConfig:
     __defaults={
-        'stgit.autoresolved':	'no',
         'stgit.smtpserver':	'localhost:25',
         'stgit.smtpdelay':	'5',
         'stgit.pullcmd':	'git pull',
diff --git a/t/t0002-status.sh b/t/t0002-status.sh
index ffcad77..2512c53 100755
--- a/t/t0002-status.sh
+++ b/t/t0002-status.sh
@@ -145,7 +145,7 @@ A fie
 M foo/bar
 EOF
 test_expect_success 'Status after resolving the push' '
-    stg resolved -a &&
+    git add --update &&
     stg status > output.txt &&
     test_cmp expected.txt output.txt
 '
diff --git a/t/t2000-sync.sh b/t/t2000-sync.sh
index 00ea7bd..d550538 100755
--- a/t/t2000-sync.sh
+++ b/t/t2000-sync.sh
@@ -117,7 +117,7 @@ test_expect_success \
     '
     [ "$(echo $(stg series --applied --noprefix))" = "p1" ] &&
     [ "$(echo $(stg series --unapplied --noprefix))" = "p2 p3" ] &&
-    stg resolved -a &&
+    git add --update &&
     stg refresh &&
     stg goto p3
     [ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
@@ -135,7 +135,7 @@ test_expect_success \
     '
     [ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
     [ "$(echo $(stg series --unapplied --noprefix))" = "" ] &&
-    stg resolved -a &&
+    git add --update &&
     stg refresh &&
     [ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
     [ "$(echo $(stg series --unapplied --noprefix))" = "" ]

             reply	other threads:[~2009-05-29 21:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-29 21:30 Catalin Marinas [this message]
2009-05-31  8:21 ` [StGit PATCH] Remove the resolved command Karl Hasselström

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090529213013.8908.45041.stgit@localhost.localdomain \
    --to=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.com \
    /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.
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).