git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org, "David Kågedal" <davidk@lysator.liu.se>
Subject: [StGit PATCH 3/5] Let some commands work with detached HEAD
Date: Sun, 11 Nov 2007 20:43:49 +0100	[thread overview]
Message-ID: <20071111194349.18868.77565.stgit@yoghurt> (raw)
In-Reply-To: <20071111193545.18868.62490.stgit@yoghurt>

add, resolved, and status didn't use the crt_series that was
initialized for them. So don't initialize it, since that means (1)
less work and (2) they won't fail when HEAD is detached.

Note that this doesn't completely fix the problem with detached HEAD:
a number of other commands (e.g. branch) don't always need to refer to
a current series, but currently fails on a detached HEAD even in those
situations.

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

---

 stgit/commands/add.py      |    2 +-
 stgit/commands/resolved.py |    2 +-
 stgit/commands/status.py   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/stgit/commands/add.py b/stgit/commands/add.py
index 264ab9f..ceea188 100644
--- a/stgit/commands/add.py
+++ b/stgit/commands/add.py
@@ -31,7 +31,7 @@ Add the files or directories passed as arguments to the
 repository. When a directory name is given, all the files and
 subdirectories are recursively added."""
 
-directory = DirectoryHasRepository()
+directory = DirectoryHasRepository(needs_current_series = False)
 options = []
 
 
diff --git a/stgit/commands/resolved.py b/stgit/commands/resolved.py
index 236ffd7..011db91 100644
--- a/stgit/commands/resolved.py
+++ b/stgit/commands/resolved.py
@@ -34,7 +34,7 @@ Mark a merge conflict as resolved. The conflicts can be seen with the
 'C'. This command also removes any <file>.{ancestor,current,patched}
 files."""
 
-directory = DirectoryHasRepository()
+directory = DirectoryHasRepository(needs_current_series = False)
 options = [make_option('-a', '--all',
                        help = 'mark all conflicts as solved',
                        action = 'store_true'),
diff --git a/stgit/commands/status.py b/stgit/commands/status.py
index 5763d09..20614b0 100644
--- a/stgit/commands/status.py
+++ b/stgit/commands/status.py
@@ -40,7 +40,7 @@ under revision control. The files are prefixed as follows:
 A 'refresh' command clears the status of the modified, new and deleted
 files."""
 
-directory = DirectoryHasRepository()
+directory = DirectoryHasRepository(needs_current_series = False)
 options = [make_option('-m', '--modified',
                        help = 'show modified files only',
                        action = 'store_true'),

  parent reply	other threads:[~2007-11-11 19:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11 19:43 [StGit PATCH 0/5] A few small fixes Karl Hasselström
2007-11-11 19:43 ` [StGit PATCH 1/5] Simple test for "stg clean" Karl Hasselström
2007-11-11 19:43 ` [StGit PATCH 2/5] Cogito is deprecated, so don't point to it Karl Hasselström
2007-11-11 19:43 ` Karl Hasselström [this message]
2007-11-11 19:43 ` [StGit PATCH 4/5] Rename "stg assimilate" to "stg repair" Karl Hasselström
2007-11-11 19:44 ` [StGit PATCH 5/5] stg repair: Patchify non-patch commits between patches Karl Hasselström
2007-11-12 11:02 ` [StGit PATCH 0/5] A few small fixes Catalin Marinas
2007-11-12 13:01   ` 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

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

  git send-email \
    --in-reply-to=20071111194349.18868.77565.stgit@yoghurt \
    --to=kha@treskal.com \
    --cc=catalin.marinas@gmail.com \
    --cc=davidk@lysator.liu.se \
    --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).