From: Elijah Newren <newren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Ensure proper setup of git_dir for git-hash-object
Date: Sat, 28 Feb 2009 14:20:32 -0700 [thread overview]
Message-ID: <51419b2c0902281320neec7960vfbe7b806c8db56ca@mail.gmail.com> (raw)
In-Reply-To: <7v3adyffax.fsf@gitster.siamese.dyndns.org>
On Sat, Feb 28, 2009 at 1:59 PM, Junio C Hamano <gitster@pobox.com> wrote:
> newren@gmail.com writes:
>
>> Without this patch:
>> $ mkdir tmp
>> $ cd tmp/
>> $ git init --bare
>> Initialized empty Git repository in /home/newren/floss-development/git/tmp/
>> $ echo hi | git hash-object -w --stdin
>> error: unable to create temporary sha1 filename .git/objects/45: No such file or directory
>>
>> fatal: Unable to add stdin to database
>> $ echo hi | git --git-dir=. hash-object -w --stdin
>> 45b983be36b73c0788dc9cbcb76cbb80fc7bb057
>
> Does the patched version work without -w option? Should it?
Yes, the patched version works with or without the -w option (at least
in my testing -- maybe you know of a case I'm missing?) I would
certainly expect it to work in both cases.
I basically arrived at the patch by realizing that git_config was
setting git_dir incorrectly as a side-effect, causing
setup_git_directory to notice it was already set and not try any of
it's more detailed logic to figure out the correct value. Then I did
some grepping and noticed that other source files (archive.c,
builtin-apply.c, builtin-diff, etc., etc.) call
setup_git_directory[_gently] before git_config, and that hash-object.c
seemed to be the only one that didn't follow that trend.
next prev parent reply other threads:[~2009-02-28 21:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-28 19:56 [PATCH] Ensure proper setup of git_dir for git-hash-object newren
2009-02-28 20:59 ` Junio C Hamano
2009-02-28 21:20 ` Elijah Newren [this message]
2009-02-28 21:39 ` Elijah Newren
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=51419b2c0902281320neec7960vfbe7b806c8db56ca@mail.gmail.com \
--to=newren@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.