From: Jeff King <peff@peff.net>
To: Deskin Miller <deskinm@umich.edu>
Cc: kenneth johansson <ken@kenjo.org>,
git@vger.kernel.org, gitster@pobox.com
Subject: Re: [RFC PATCH] archive: fix setup to work in bare repositories
Date: Wed, 22 Oct 2008 16:46:50 -0400 [thread overview]
Message-ID: <20081022204650.GD4585@coredump.intra.peff.net> (raw)
In-Reply-To: <20081022203722.GD2015@riemann.deskinm.fdns.net>
On Wed, Oct 22, 2008 at 04:37:22PM -0400, Deskin Miller wrote:
> cmd_archive was calling git_config -> setup_git_env prior to
> write_archive calling setup_git_directory. In a bare repository, the
> former will set git_dir to be '.git' since the latter has not
> determined that it's operating in a bare repository yet.
>
> Things are complicated, however, by the fact that git archive --list
> should work from anywhere, not just in git repositories, so that
> argument needs to be checked for before setup_git_directory is called.
Should you perhaps be able to call setup_git_directory_gently(), and
then once you decide that you really do need the setup, call
setup_git_directory()?
You would have to add a "did we already do run" flag to
setup_git_directory_gently(), but I think it is already an error to call
it twice, so you wouldn't be hurting anything by that.
Note also that by moving the setup, you are moving the chdir() that
happens; you may need to prefix paths to any arguments to accomodate
this (I don't think it should matter, since git-archive shouldn't look
at any paths until after it would have done the setup_git_directory()
before, but I didn't check carefully).
-Peff
next prev parent reply other threads:[~2008-10-22 20:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-22 8:42 git archive kenneth johansson
2008-10-22 13:08 ` Deskin Miller
2008-10-22 18:45 ` kenneth johansson
2008-10-22 20:37 ` [RFC PATCH] archive: fix setup to work in bare repositories Deskin Miller
2008-10-22 20:46 ` Jeff King [this message]
2008-10-22 21:09 ` Charles Bailey
2008-10-22 21:47 ` [PATCH] Fixed git archive for bare repos Charles Bailey
2008-10-23 1:37 ` Deskin Miller
2008-10-24 22:19 ` René Scharfe
2008-10-25 15:38 ` [PATCH v2] " Deskin Miller
2008-10-25 19:15 ` Junio C Hamano
2008-10-23 15:33 ` git archive Nguyen Thai Ngoc Duy
2008-10-23 18:21 ` Deskin Miller
2008-10-24 3:58 ` Nguyen Thai Ngoc Duy
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=20081022204650.GD4585@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=deskinm@umich.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ken@kenjo.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).