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
Subject: [StGit PATCH 6/6] Let some commands work with detached HEAD
Date: Mon, 08 Oct 2007 10:55:41 +0200	[thread overview]
Message-ID: <20071008085540.9734.60137.stgit@yoghurt> (raw)
In-Reply-To: <20071008085430.9734.75797.stgit@yoghurt>

add, diff, 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/diff.py     |    2 +-
 stgit/commands/resolved.py |    2 +-
 stgit/commands/status.py   |    2 +-
 4 files changed, 4 insertions(+), 4 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/diff.py b/stgit/commands/diff.py
index 42e8367..9ffbb4a 100644
--- a/stgit/commands/diff.py
+++ b/stgit/commands/diff.py
@@ -42,7 +42,7 @@ rev = '([patch][//[bottom | top]]) | <tree-ish> | base'
 If neither bottom nor top are given but a '//' is present, the command
 shows the specified patch (defaulting to the current one)."""
 
-directory = DirectoryHasRepository()
+directory = DirectoryHasRepository(needs_current_series = False)
 options = [make_option('-r', '--range',
                        metavar = 'rev1[..[rev2]]', dest = 'revs',
                        help = 'show the diff between revisions'),
diff --git a/stgit/commands/resolved.py b/stgit/commands/resolved.py
index c2ef678..8b2aba2 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 a688f7e..360fabf 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-10-08  8:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08  8:55 [StGit PATCH 0/6] Survive capital punishment Karl Hasselström
2007-10-08  8:55 ` [StGit PATCH 1/6] Allow caller to customize title of error/warning message Karl Hasselström
2007-10-08  8:55 ` [StGit PATCH 2/6] Use our nice message printout wrapping system Karl Hasselström
2007-10-08  8:55 ` [StGit PATCH 3/6] Properly detect that HEAD is detached Karl Hasselström
2007-10-08  8:55 ` [StGit PATCH 4/6] Refactor crt_series creation Karl Hasselström
2007-10-08  8:55 ` [StGit PATCH 5/6] Don't have a global crt_series in stgit.commans.common Karl Hasselström
2007-10-08  8:55 ` Karl Hasselström [this message]
2007-10-08 15:34   ` [StGit PATCH 6/6] Let some commands work with detached HEAD Karl Hasselström
2007-10-09  4:42     ` [StGit PATCH] New test: "stg diff" Karl Hasselström
2007-10-09  5:12     ` [StGit PATCH 6/6] Let some commands work with detached HEAD Karl Hasselström
2007-10-08  8:58 ` [StGit PATCH 0/6] Survive capital punishment Karl Hasselström
2007-10-08  9:27   ` 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=20071008085540.9734.60137.stgit@yoghurt \
    --to=kha@treskal.com \
    --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).