git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Lichtenheld <frank@lichtenheld.de>
To: Junio C Hamano <junkio@cox.net>
Cc: Git Mailing List <git@vger.kernel.org>,
	Frank Lichtenheld <frank@lichtenheld.de>
Subject: [PATCH 1/4] var: Don't require to be in a git repository.
Date: Fri, 14 Mar 2008 18:29:27 +0100	[thread overview]
Message-ID: <1205515770-3424-2-git-send-email-frank@lichtenheld.de> (raw)
In-Reply-To: <1205515770-3424-1-git-send-email-frank@lichtenheld.de>

git var works fine even when not called in a git repository. So
don't require it.

This will make it possible to remove this pre-condition for some
other git commands as well.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 var.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/var.c b/var.c
index 0de0efa..c20ac91 100644
--- a/var.c
+++ b/var.c
@@ -51,11 +51,12 @@ static int show_config(const char *var, const char *value)
 int main(int argc, char **argv)
 {
 	const char *val;
+	int nongit;
 	if (argc != 2) {
 		usage(var_usage);
 	}
 
-	setup_git_directory();
+	setup_git_directory_gently(&nongit);
 	val = NULL;
 
 	if (strcmp(argv[1], "-l") == 0) {
-- 
1.5.4.4

  reply	other threads:[~2008-03-14 17:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-14 17:29 [PATCH 0/4] Don't require to be in the repository if we don't need to Frank Lichtenheld
2008-03-14 17:29 ` Frank Lichtenheld [this message]
2008-03-14 17:29   ` [PATCH 2/4] Git.pm: Don't require a repository instance for config Frank Lichtenheld
2008-03-14 17:29     ` [PATCH 3/4] Git.pm: Don't require repository instance for ident Frank Lichtenheld
2008-03-14 17:29       ` [PATCH 4/4] send-email: Don't require to be called in a repository Frank Lichtenheld
2008-03-16  3:55 ` [PATCH 0/4] Don't require to be in the repository if we don't need to Junio C Hamano

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=1205515770-3424-2-git-send-email-frank@lichtenheld.de \
    --to=frank@lichtenheld.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).