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 6, 2008, 23:22 UTC
Message-ID
<HBFmgmcvgPzZ0xq-fRUt98ZOBXGCvwxHGyEwF9bNcgpDgS-t-D3viw@cipher.nrlssc.navy.mil>
In-Reply-To
<GV8cY3fn8l5UV5cNoPN8bHchWt9u2tbZ8j_ypkiY-ZLfO1tx9d7ebA@cipher.nrlssc.navy.mil>
Brandon Casey wrote:
> Junio,
> 
> Please leave this in pu for now, I have some concerns that I haven't
> had time to write down yet.
I've been thinking about pack-objects and repack.
Here's how I think the semantics of repack should be defined:
repack:
  <no-options>
    -incremental repack which does not repack any object currently packed
     in any accessible pack.
    Works (it currently works this way).
  <-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
    Flawed, even with my recent patches.
    If there are no local packs (or they all have .keep files), then the
    pack-objects call will use --incremental which will exclude objects
    packed in alt object store, even though -l was not used.
 
    My patches do not differentiate local .keep files from remote .keep files,
    which a user may have no control over.
  <-A>
     -Like -a, but local unreferenced objects which were previously packed
      are made to be loose.
    Ditto.
  <-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.
     Works with my recent patches.
  <-A -l>
     -Like '-a -l', but loosen unreferenced local packed objects.
     Ditto.

That set of repack operations needs to map to a combination of pack-objects options:

  <no-options>
     -Create a pack with _all_ specified objects
  <--unpacked>
     -Exclude from packing any object already in an accessible pack.
     (Ahh, this came from rev-list interface, and rejects objects at an
      earlier stage than --incremental)
  <--unpacked=sha1>
     -Like '--unpacked', exclude already packed objects, but treat the objects
      in the pack with specified sha1 as unpacked.
  <--incremental>
     -Exclude from packing any object already in an accessible pack,
      regardless of whether it is in a pack specified by --unpacked=
      (How is this different from --unpacked, even though the exclusion
       operation is performed at a different stage? See my epiphany above
       about the source of the --unpacked option)
  <--unpacked --incremental>
     -seems redundant, is there any functional difference?
  <--local>
     -Exclude objects from being packed that are not in the local object store.

The issue is how to provide my described 'repack -a' functionality. There does not seem to be a mapping between the above options and the required functionality.

I see two solutions, both require introducing a new option to pack-objects.
  1) allow specifying a set of packs such that if an object resides
     in any of the set, the object will not be included in the produced
     pack.
     Benefits:
     -allows keeping pack-objects ignorant of .keep mechanism
     -repack can easily be modified to produce the set of packs to ignore
     Drawback:
     -very round-about way just to have functionality to skip packs with
      .keep file
  2) New option telling pack-objects to skip objects in local .keep'd packs
     Benefits:
     -easy to implement in pack-objects
     -easy to modify repack
     Drawbacks:
     -introduces new concept to pack-objects
Questions aside:
  1) Are both --incremental and --unpacked still necessary pack-objects options?
  2) Can --incremental become an alias for --unpacked, and go away?
patch(es) will follow.
-brandon
Previous: Brandon CaseyNext: Junio C Hamano
Message 17 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.