git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] Add a --nosort option to pack-objects

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 7, 2007, 21:25 UTC
Message-ID
<7v4peu19kr.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1197061832-8489-1-git-send-email-mh@glandium.org>
Mike Hommey <mh@glandium.org> writes:
> The --nosort option disabled the internal sorting used by pack-objects,
> and runs the sliding window along the object list litterally as given on
> stdin.
I think this is a good way to give people an easier way to experiment.

But it makes me wonder if this is disabling too much, and if the list should be sorted at least by type, as we won't delta different types of objects against each other.

At the beginning of try_delta(), when we see that the next candidate is
of a different type, we return -1 telling the caller that "No object in
the window will ever be a good delta base for the current object, please
abort".  This relies on the fact that we sort by type first, so I think
one of the following is necessary:
 
 (1) you weaken this check (return 0, saying "This did not delta well but
     do not give up yet"),
 (2) you document this well so that --nosort user will know, or
 (3) you sort --nosort input by type.
>   I would obviously add the appropriate documentation for this flag if this
>   is accepted. I'll also try to send another documentation patch for
>   pack-objects with some information compiled from Linus's explanation to my
>   last message about pack-objects.
I need to rant here a bit.

Sometimes people say "Here is my patch. If this is accepted, I'll add documentation and tests". My reaction is, "Don't you, as the person who proposes that change, believe in your patch deeply enough yourself to be willing to perfect it, to make it suitable for consumption by the general public, whether it is included in my tree or not? A change that even you do not believe in deeply enough probably to perfect would not benefit the general public, so thanks but no thanks, I'll pass."

Fortunately we haven't had this problem too many times on this list.
I would not have minded at all if you said:
	Obviously, appropriate documentation and tests are needed before
	inclusion, but I am sending this out primarily to seek opinions
	from the list to make sure this is going in the right direction,
	iow, this is an RFC.
What bugged me was the phrase "if this is accepted".
Previous: Mike HommeyNext: Junio C Hamano
Message 4 of 8 in “Add a --nosort option to pack-objects”
  1. Add a --nosort option to pack-objectsMike Hommey, Dec 7, 2007
  2. Nicolas PitreDec 7, 2007
  3. Mike HommeyDec 7, 2007
  4. Junio C HamanoDec 7, 2007
  5. Junio C HamanoDec 7, 2007
  6. Mike HommeyDec 7, 2007
  7. Nicolas PitreDec 7, 2007
  8. Mike HommeyDec 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.