git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: Johan Herland <johan@herland.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fix 'git cvsexportcommit -w $cvsdir ...' when used with relative $GIT_DIR
Date: Mon, 11 Feb 2008 21:58:16 +0100	[thread overview]
Message-ID: <200802112158.16830.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <200802110228.05233.johan@herland.net>

måndagen den 11 februari 2008 skrev Johan Herland:
> When using the '-w $cvsdir' option to cvsexportcommit, it will chdir into
> $cvsdir before executing several other git commands. If $GIT_DIR is set to
> a relative path (e.g. '.'), the git commands executed by cvsexportcommit
> will naturally fail with "fatal: Not a git repository".
[...]

>  die "Need at least one commit identifier!" unless @ARGV;
>  
>  if ($opt_w) {
> +	# Remember where GIT_DIR is before changing to CVS checkout
>  	unless ($ENV{GIT_DIR}) {
> -		# Remember where our GIT_DIR is before changing to CVS checkout
> +		# Oops no GIT_DIR set. Figure out for ourselves

That's not an "Oops". It's perfectly normal not to have GIT_DIR set.

>  		my $gd =`git-rev-parse --git-dir`;
>  		chomp($gd);
> -		if ($gd eq '.git') {
> -			my $wd = `pwd`;Kopia
> -			chomp($wd);
> -			$gd = $wd."/.git"	;
> -		}
> +		$ENV{GIT_DIR} = $gd;
> +	}
> +	unless ($ENV{GIT_DIR} =~ m[^/]) {
> +		# GIT_DIR is relative. Prepend $PWD
Hmm. C:/foo? You should probably use rel2abs in the File::Spec
module.

-- robin

  parent reply	other threads:[~2008-02-11 23:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-11  1:28 [PATCH] Fix 'git cvsexportcommit -w $cvsdir ...' when used with relative $GIT_DIR Johan Herland
2008-02-11 20:10 ` Junio C Hamano
2008-02-11 20:58 ` Robin Rosenberg [this message]
2008-02-11 23:43   ` Johan Herland
2008-02-12 20:41     ` Robin Rosenberg
2008-02-13  3:11       ` [PATCH] Add testcase for 'git cvsexportcommit -w $cvsdir ...' " Johan Herland
2008-02-13  7:58         ` Junio C Hamano
2008-02-13  9:26           ` Jakub Narebski

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=200802112158.16830.robin.rosenberg.lists@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=johan@herland.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).