git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <cel@citi.umich.edu>
To: Pavel Roskin <proski@gnu.org>
Cc: Catalin Marinas <catalin.marinas@gmail.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] stgit: fix clone
Date: Wed, 11 Jan 2006 17:39:18 -0500	[thread overview]
Message-ID: <43C58916.6030409@citi.umich.edu> (raw)
In-Reply-To: <1137017966.10975.8.camel@dv>

[-- Attachment #1: Type: text/plain, Size: 2047 bytes --]

hi pavel-

exactly where does the clone operation fail?  is it at the checkout step?

seems to me the "git clone" script should create an environment where 
"git-rev-parse --git-dir" ought to work correctly.

Pavel Roskin wrote:
> "stg clone" is currently broken:
> 
> $ stg clone http://homepage.ntlworld.com/cmarinas/stgit.git    
> stg clone: git-rev-parse --git-dir failed
> 
> This happens with current git.  "git-rev-parse --git-dir" doesn't work
> in an empty directory.  The patch avoids running "git-rev-parse
> --git-dir" when the requested command doesn't assume existence of git
> repository.
> 
> Signed-off-by: Pavel Roskin <proski@gnu.org>
> 
> ---
> Warning: this is my first non-trivial patch to StGIT and the first patch
> to a Python program.
> 
> diff --git a/stgit/git.py b/stgit/git.py
> index a7b1c3f..0e63f69 100644
> --- a/stgit/git.py
> +++ b/stgit/git.py
> @@ -82,13 +82,16 @@ __commits = dict()
>  # Functions
>  #
>  
> -def get_base_dir():
> +def get_base_dir(assume_top = False):
>      """Different start-up variables read from the environment
>      """
>      if 'GIT_DIR' in os.environ:
>          return os.environ['GIT_DIR']
>      else:
> -        return _output_one_line('git-rev-parse --git-dir')
> +        if assume_top:
> +            return '.git'
> +        else:
> +            return _output_one_line('git-rev-parse --git-dir')
>  
>  def get_commit(id_hash):
>      """Commit objects factory. Save/look-up them in the __commits
> diff --git a/stgit/stack.py b/stgit/stack.py
> index 8b7c296..1c080b3 100644
> --- a/stgit/stack.py
> +++ b/stgit/stack.py
> @@ -263,7 +263,7 @@ class Series:
>              self.__name = git.get_head_file()
>  
>          if self.__name:
> -            base_dir = git.get_base_dir()
> +            base_dir = git.get_base_dir(assume_top = (name == 'master'))
>              self.__patch_dir = os.path.join(base_dir, 'patches',
>                                              self.__name)
>              self.__base_file = os.path.join(base_dir, 'refs', 'bases',
> 
> 


[-- Attachment #2: cel.vcf --]
[-- Type: text/x-vcard, Size: 451 bytes --]

begin:vcard
fn:Chuck Lever
n:Lever;Charles
org:Network Appliance, Incorporated;Open Source NFS Client Development
adr:535 West William Street, Suite 3100;;Center for Information Technology Integration;Ann Arbor;MI;48103-4943;USA
email;internet:cel@citi.umich.edu
title:Member of Technical Staff
tel;work:+1 734 763-4415
tel;fax:+1 734 763 4434
tel;home:+1 734 668-1089
x-mozilla-html:FALSE
url:http://troy.citi.umich.edu/u/cel/
version:2.1
end:vcard


  reply	other threads:[~2006-01-11 22:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-11 22:19 [PATCH] stgit: fix clone Pavel Roskin
2006-01-11 22:39 ` Chuck Lever [this message]
2006-01-11 22:47   ` Chuck Lever
2006-01-12 11:54     ` Catalin Marinas
2006-01-12 14:51       ` Chuck Lever
2006-01-13  5:24       ` Pavel Roskin

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=43C58916.6030409@citi.umich.edu \
    --to=cel@citi.umich.edu \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=proski@gnu.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).