From: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Nicolas Pitre <nico@cam.org>,
git@vger.kernel.org, Mark Levedahl <mdl123@verizon.net>,
Junio C Hamano <junkio@cox.net>
Subject: Re: [PATCH] Add git-bundle: move objects and references by archive
Date: Thu, 22 Feb 2007 17:46:15 +0100 [thread overview]
Message-ID: <45DDC8D7.60902@fs.ei.tum.de> (raw)
In-Reply-To: <Pine.LNX.4.63.0702221735130.22628@wbgn013.biozentrum.uni-wuerzburg.de>
[-- Attachment #1: Type: text/plain, Size: 2048 bytes --]
Johannes Schindelin wrote:
> Hi,
>
> On Thu, 22 Feb 2007, Simon 'corecode' Schubert wrote:
>
>> Johannes Schindelin wrote:
>>> Hi,
>>>
>>> On Wed, 21 Feb 2007, Nicolas Pitre wrote:
>>>
>>>> On Thu, 22 Feb 2007, Johannes Schindelin wrote:
>>>>
>>>>> diff --git a/index-pack.c b/index-pack.c
>>>>> index fa9a0e7..5ccf4c4 100644
>>>>> --- a/index-pack.c
>>>>> +++ b/index-pack.c
>>>>> @@ -457,8 +457,8 @@ static void parse_pack_objects(unsigned char *sha1)
>>>>> /* If input_fd is a file, we should have reached its end now. */
>>>>> if (fstat(input_fd, &st))
>>>>> die("cannot fstat packfile: %s", strerror(errno));
>>>>> - if (S_ISREG(st.st_mode) && st.st_size != consumed_bytes)
>>>>> - die("pack has junk at the end");
>>>>> + if (input_fd && S_ISREG(st.st_mode) && st.st_size != consumed_bytes)
>>>>> + die("pack has junk at the end: 0%o, %d, %d %d", st.st_mode,
>>>>> (int)st.st_size, (int)consumed_bytes, input_fd);
>>>>> if (!nr_deltas)
>>>>> return;
>>>> What is this supposed to mean?
>>> The funny thing is, if you stream part of the bundle file to index-pack,
>>> S_ISREG(st.st_mode) is true, even if input_fd == 0.
>> Well, of course: you opened a regular file and pass this as stdin to
>> index-pack.
>>
>> Maybe something like this would be cleaner:
>>
>> if (IS_REF(st.st_mode) && lseek(input_fd, 0, SEEK_CUR) != st.st_size)
>> die("...");
>
> The lseek would fail whenever the input is _not_ a file, dying. Since
> index-pack is called from fetch-pack, with a socket instead of a file, it
> would fail for the most common user.
that's why i put IS_REF (should read IS_REG) there.
but as nicolas pointed out, this won't work for read-ahead.
cheers
simon
--
Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\
Work - Mac +++ space for low €€€ NOW!1 +++ Campaign \ /
Party Enjoy Relax | http://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2007-02-22 16:47 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.63.0702220157130.22628@wbgn013.biozentrum.uni-wuerz burg.de>
2007-02-22 0:59 ` [PATCH] Add git-bundle: move objects and references by archive Johannes Schindelin
2007-02-22 3:28 ` Nicolas Pitre
2007-02-22 15:55 ` Johannes Schindelin
2007-02-22 16:14 ` Simon 'corecode' Schubert
2007-02-22 16:28 ` Nicolas Pitre
2007-02-22 16:37 ` Johannes Schindelin
2007-02-22 16:46 ` Simon 'corecode' Schubert [this message]
2007-02-22 17:09 ` Johannes Schindelin
2007-02-22 16:24 ` Nicolas Pitre
2007-02-22 17:12 ` Johannes Schindelin
2007-02-22 17:21 ` Nicolas Pitre
2007-02-22 6:56 ` Junio C Hamano
2007-02-22 7:08 ` Junio C Hamano
2007-02-22 16:20 ` Johannes Schindelin
2007-02-22 19:10 ` Junio C Hamano
2007-02-22 19:16 ` Johannes Schindelin
2007-02-22 20:05 ` Junio C Hamano
2007-02-22 20:25 ` Johannes Schindelin
2007-02-22 16:17 ` Johannes Schindelin
2007-02-23 2:32 ` Mark Levedahl
2007-02-23 4:39 ` Junio C Hamano
2007-02-22 9:31 ` Johannes Sixt
2007-02-22 18:14 ` [PATCH] git-bundle: assorted fixes Johannes Schindelin
2007-02-23 1:36 ` Mark Levedahl
2007-02-23 1:56 ` Johannes Schindelin
2007-02-23 2:12 ` Mark Levedahl
2007-02-23 2:17 ` Johannes Schindelin
2007-02-23 3:37 ` Mark Levedahl
2007-02-18 22:47 [PATCH] Add git-bundle: move objects and references by archive Mark Levedahl
2007-02-19 1:07 ` Johannes Schindelin
2007-02-19 1:50 ` Junio C Hamano
2007-02-19 2:02 ` Johannes Schindelin
2007-02-19 7:56 ` Shawn O. Pearce
2007-02-19 13:29 ` Mark Levedahl
2007-02-19 15:03 ` Johannes Schindelin
2007-02-19 1:49 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2007-02-17 18:41 [PATCH] Add git-unbundle - unpack objects and references for disconnected transfer Junio C Hamano
2007-02-18 17:27 ` [PATCH] Add git-bundle: move objects and references by archive Mark Levedahl
2007-02-18 22:47 ` Mark Levedahl
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=45DDC8D7.60902@fs.ei.tum.de \
--to=corecode@fs.ei.tum.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=mdl123@verizon.net \
--cc=nico@cam.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).