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

Re: [PATCH v2 3/3] pack-objects: honor '.keep' files

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Nov 7, 2008, 01:17 UTC
Message-ID
<BgEXN35P6wpio928OZi_34hs22vqUQxIAIGxR5hR8LqmfPIyw565Mg@cipher.nrlssc.navy.mil>
In-Reply-To
<7v8wrwidi3.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 9 quoted lines
> Brandon Casey <casey@nrlssc.navy.mil> writes:
> 
>>   <-a>
>>     -create a new pack containing all objects required by the repository
>>      including those accessible through alternates, but excluding objects
>>      in _local_ packs with .keep
> 
> I have a feeling that it is debatable if this "fattening to dissociate
> from alternates" is what people want.
I'm not sure I understand you here.

Andreas has suggested previously that 'repack -a' should pack everything, including objects in packs with .keep. Is that what you mean?

With my current understanding it seems that that would muddy the semantics of repack. If -a does not honor packs with .keep, then would it be intuitive to expect that adding -l (i.e. exclude alternate packed objects) _would_ honor .keep?

Show 8 quoted lines
>>   <-a -l>
>>      -Restrict operation to only local objects. Only has any effect with -a|-A.
>>      -Like -a, but additionally exclude objects in packs accessible through
>>       alternates.
> 
> Presumably you meant "exclude objects accessible through alternates,
> either in packs or in loose form"?  If so then I think it is a good thing
> to have.

Would that be an enhancement to the current behavior? I don't think I saw any mechanism to exclude packing remote loose objects.

The documentation for pack-objects --local says:
  --local
         This flag is similar to --incremental; instead of ignoring  all
         packed objects, it only ignores objects that are packed and not
         in the local object store (i.e. borrowed from an alternate).
It only mentions packed alternate objects.
Show 6 quoted lines
> 
> I am not sure if listing the behaviour by combination of flags is a good
> way to start thinking about this.  Wouldn't it be more productive to list
> what kinds of repacking are needed, and then label them with combination
> of flags?  Otherwise you would miss a potentially useful operation that
> cannot be expressed with the current set of flags you have.

I agree. I made a list of the options because I was trying to understand what effect each option had, then I turned it into an email.

Show 17 quoted lines
> I think the useful kinds are only these five:
> 
>  - scoop loose objects that exist in local repository into a new pack,
>    without touching existing packs at all; exclude anything available in
>    any existing pack or in alternate repository (either loose or packed);
>
>  - pack everything that is needed by the local ref, except the ones that
>    are borrowed from alternate repositories (either loose or packed), into
>    a single new pack.  There are two variants of this: eject what is
>    currently packed but unnecessary into loose format when existing local
>    packs are replaced with the new pack, or lose them (i.e. -A).
>
>  - fatten local repository by packing everything that is needed by the
>    local ref into a single new pack, including things that are currently
>    borrowed from alternates.  There are two variants of this: eject what
>    is currently packed but unnecessary into loose format when existing
>    local packs are replaced with the new pack, or lose them (i.e. -A).

You didn't say when local .keep should be honored, i.e. objects in local packs with .keep should be excluded from repacking. always, never, only with -l, new repack option?

-brandon
Previous: Junio C HamanoNext: Andreas Ericsson
Message 19 of 61 in “getting list of objects for packing”
  1. Brandon CaseyOct 31, 2008
  2. Nicolas PitreOct 31, 2008
  3. Brandon CaseyOct 31, 2008
  4. Junio C HamanoOct 31, 2008
  5. Brandon CaseyOct 31, 2008
  6. Jakub NarebskiOct 31, 2008
  7. Brandon CaseyNov 1, 2008
  8. t7700: demonstrate mishandling of objects in packs with a .keep filedrafnel@gmail.com, Nov 2, 2008
  9. 1/3 packed_git: convert pack_local flag into generic bit maskdrafnel@gmail.com, Nov 2, 2008
  10. Shawn O. PearceNov 3, 2008
  11. Brandon CaseyNov 3, 2008
  12. 1/3 t7700: demonstrate mishandling of objects in packs with a .keep fileBrandon Casey, Nov 3, 2008
  13. 2/3 packed_git: convert pack_local flag into a bitfield and add pack_keepBrandon Casey, Nov 3, 2008
  14. 3/3 pack-objects: honor '.keep' filesBrandon Casey, Nov 3, 2008
  15. Shawn O. PearceNov 3, 2008
  16. Brandon CaseyNov 5, 2008
  17. Brandon CaseyNov 6, 2008
  18. Junio C HamanoNov 7, 2008
  19. Brandon CaseyNov 7, 2008
  20. Andreas EricssonNov 7, 2008
  21. Shawn O. PearceNov 7, 2008
  22. recognize loose local objects during repackdrafnel@gmail.com, Nov 10, 2008
  23. Junio C HamanoNov 10, 2008
  24. 1/4 pack-objects: new option --honor-pack-keepBrandon Casey, Nov 7, 2008
  25. 2/4 repack: don't repack local objects in packs with .keep fileBrandon Casey, Nov 7, 2008
  26. 3/4 repack: do not fall back to incremental repacking with [-a|-A]Brandon Casey, Nov 7, 2008
  27. 4/4 builtin-gc.c: use new pack_keep bitfield to detect .keep file existenceBrandon Casey, Nov 7, 2008
  28. Andreas EricssonNov 7, 2008
  29. Andreas EricssonNov 7, 2008
  30. t7700: demonstrate mishandling of objects in packs with a .keep fileBrandon Casey, Nov 3, 2008
  31. Andreas EricssonNov 4, 2008
  32. Brandon CaseyNov 4, 2008
  33. Junio C HamanoNov 4, 2008
  34. Brandon CaseyNov 4, 2008
  35. Andreas EricssonNov 4, 2008
  36. Junio C HamanoNov 4, 2008
  37. Jeff KingNov 12, 2008
  38. Junio C HamanoNov 12, 2008
  39. Jeff KingNov 12, 2008
  40. Brandon CaseyNov 12, 2008
  41. repack and .keep seriesBrandon Casey, Nov 12, 2008
  42. 1/6 t7700: demonstrate mishandling of objects in packs with a .keep fileBrandon Casey, Nov 12, 2008
  43. 2/6 packed_git: convert pack_local flag into a bitfield and add pack_keepBrandon Casey, Nov 12, 2008
  44. 3/6 pack-objects: new option --honor-pack-keepBrandon Casey, Nov 12, 2008
  45. 4/6 repack: don't repack local objects in packs with .keep fileBrandon Casey, Nov 12, 2008
  46. 5/6 repack: do not fall back to incremental repacking with [-a|-A]Brandon Casey, Nov 12, 2008
  47. 6/6 builtin-gc.c: use new pack_keep bitfield to detect .keep file existenceBrandon Casey, Nov 12, 2008
  48. t7700: test that 'repack -a' packs alternate packed objectsBrandon Casey, Nov 13, 2008
  49. Junio C HamanoNov 12, 2008
  50. Junio C HamanoNov 12, 2008
  51. Andreas EricssonNov 3, 2008
  52. Brandon CaseyNov 3, 2008
  53. Andreas EricssonNov 3, 2008
  54. Brandon CaseyNov 3, 2008
  55. Andreas EricssonNov 4, 2008
  56. 2/3 packed_git: add new PACK_KEEP flag and haspackkeep() access macrodrafnel@gmail.com, Nov 2, 2008
  57. 3/3 pack-objects: honor '.keep' filesdrafnel@gmail.com, Nov 2, 2008
  58. Shawn O. PearceNov 3, 2008
  59. 1/3 t7700: demonstrate mishandling of loose objects in an alternate ODBdrafnel@gmail.com, Nov 10, 2008
  60. 2/3 sha1_file.c: split has_loose_object() into local and non-local counterpartsdrafnel@gmail.com, Nov 10, 2008
  61. 3/3 pack-objects: extend --local to mean ignore non-local loose objects toodrafnel@gmail.com, Nov 10, 2008

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.