Re: [PATCH] fast-export: Avoid dropping files from commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Mar 25, 2009 at 9:36 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Hmm, does it?
>
> Shouldn't an export with a bottom commit be always considered an
> incremental?  Why special case --import-marks?
>
> When you say "I want to export master~2..master", isn't the intention
> (unstated, because it is too obvious) that follows it "... because I do
> have master~2 already and I would want to replay the export on top of that
> state"?  If all of master~2, master~1 and master have a file "frotz" with
> exactly the same contents, I thought you wouldn't even have to have that
> same contents repeated in the export datastream.

No, without the --import-marks it doesn't make sense to make it an
incremental.  Think of it this way: git-fast-export converts all
sha1's into integer identifiers (marks).  When you export
master~2..master, then when fast-export comes across master~1, it
notices that there's nothing to convert it's parent sha1sum into since
no information was output for master~2 in the export stream.  The way
around it would be to simply export master~2 anyway, and master~3,
and...
(An alternate way around it, I guess, would be using the sha1sum in
the export stream instead of a mark...but do you have any way of
knowing whether the destination repository you import into will have
that commit?  Using --import-marks seems like a nice way to specify
whether you have that information or not.)

It's perhaps a gotcha, as I know I had the same initial assumption
even after reading the manpage.  Perhaps
Documentation/git-fast-export.txt could be made a bit clearer on this
point.

> Or am I (again) entirely misunderstanding the intended use case?

Exporting master~2..master without specifying --import-marks is a way
of squashing history, essentially.  Perhaps you don't like it serving
this purpose, but it was intentional; looking at the master~2..master
testcase in t/t9301-fast-export.sh, you'll see

   git fast-export master~2..master | sed "s/master/partial/" |
   <snip some other boilerplate> &&  test_must_fail git rev-parse partial~2
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux