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

[PATCH v2 00/36] object_id part 12

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 25, 2018, 21:11 UTC
Message-ID
<20180225211212.477570-1-sandals@crustytoothpaste.net>

This is the twelfth in a series of patches to convert various parts of the code to struct object_id.

The primary changes here are to the sha1_file code, find_unique_abbrev, and lookup_replace_object. Due to the circular nature of converting the latter, there are several places where we briefly insert temporaries to allow a multi-patch conversion.

Also included is a constant for object header length allocation. This isn't strictly related to the series, but it makes for a nice cleanup of hard-coded constants, which is good for maintainability.

This series further decreases the number of hard-coded constants in the code. After this series, there are only 172 instances of the constant "20" in the code (for any purpose) and 98 instances of "40".

Changes from v1:
* Rebase onto master.
brian m. carlson (36):
  bulk-checkin: convert index_bulk_checkin to struct object_id
  builtin/write-tree: convert to struct object_id
  cache-tree: convert write_*_as_tree to object_id
  cache-tree: convert remnants to struct object_id
  resolve-undo: convert struct resolve_undo_info to object_id
  tree: convert read_tree_recursive to struct object_id
  ref-filter: convert grab_objectname to struct object_id
  strbuf: convert strbuf_add_unique_abbrev to use struct object_id
  wt-status: convert struct wt_status_state to object_id
  Convert find_unique_abbrev* to struct object_id
  http-walker: convert struct object_request to use struct object_id
  send-pack: convert remaining functions to struct object_id
  replace_object: convert struct replace_object to object_id
  builtin/mktag: convert to struct object_id
  archive: convert write_archive_entry_fn_t to object_id
  archive: convert sha1_file_to_archive to struct object_id
  builtin/index-pack: convert struct ref_delta_entry to object_id
  sha1_file: convert read_loose_object to use struct object_id
  sha1_file: convert check_sha1_signature to struct object_id
  streaming: convert open_istream to use struct object_id
  builtin/mktree: convert to struct object_id
  sha1_file: convert assert_sha1_type to object_id
  sha1_file: convert retry_bad_packed_offset to struct object_id
  packfile: convert unpack_entry to struct object_id
  Convert remaining callers of sha1_object_info_extended to object_id
  sha1_file: convert sha1_object_info* to object_id
  builtin/fmt-merge-msg: convert remaining code to object_id
  builtin/notes: convert static functions to object_id
  tree-walk: convert get_tree_entry_follow_symlinks internals to
    object_id
  streaming: convert istream internals to struct object_id
  tree-walk: convert tree entry functions to object_id
  sha1_file: convert read_object_with_reference to object_id
  sha1_file: convert read_sha1_file to struct object_id
  Convert lookup_replace_object to struct object_id
  sha1_file: introduce a constant for max header length
  convert: convert to struct object_id
 apply.c                  |   4 +-
 archive-tar.c            |  28 ++++----
 archive-zip.c            |  18 ++---
 archive.c                |  32 ++++-----
 archive.h                |  10 +--
 bisect.c                 |   3 +-
 blame.c                  |  18 +++--
 builtin/am.c             |   8 +--
 builtin/blame.c          |   2 +-
 builtin/branch.c         |   2 +-
 builtin/cat-file.c       |  30 +++++----
 builtin/checkout.c       |  12 ++--
 builtin/commit-tree.c    |   2 +-
 builtin/describe.c       |   4 +-
 builtin/difftool.c       |   2 +-
 builtin/fast-export.c    |   8 +--
 builtin/fetch.c          |  10 +--
 builtin/fmt-merge-msg.c  |   4 +-
 builtin/fsck.c           |   4 +-
 builtin/grep.c           |   6 +-
 builtin/index-pack.c     |  43 ++++++------
 builtin/log.c            |   8 +--
 builtin/ls-files.c       |   4 +-
 builtin/ls-tree.c        |   8 +--
 builtin/merge-tree.c     |   5 +-
 builtin/merge.c          |   8 +--
 builtin/mktag.c          |  20 +++---
 builtin/mktree.c         |  24 +++----
 builtin/name-rev.c       |   2 +-
 builtin/notes.c          |  14 ++--
 builtin/pack-objects.c   |  27 ++++----
 builtin/prune.c          |   2 +-
 builtin/receive-pack.c   |   8 +--
 builtin/reflog.c         |   2 +-
 builtin/replace.c        |  10 +--
 builtin/reset.c          |   2 +-
 builtin/rev-list.c       |   2 +-
 builtin/rev-parse.c      |   2 +-
 builtin/rm.c             |   2 +-
 builtin/show-branch.c    |   2 +-
 builtin/show-ref.c       |   4 +-
 builtin/tag.c            |  16 +++--
 builtin/unpack-file.c    |   2 +-
 builtin/unpack-objects.c |   4 +-
 builtin/update-index.c   |   2 +-
 builtin/verify-commit.c  |   2 +-
 builtin/worktree.c       |   4 +-
 builtin/write-tree.c     |   6 +-
 bulk-checkin.c           |  18 ++---
 bulk-checkin.h           |   2 +-
 bundle.c                 |   2 +-
 cache-tree.c             |  36 +++++-----
 cache-tree.h             |   4 +-
 cache.h                  |  42 ++++++------
 combine-diff.c           |   6 +-
 commit.c                 |   8 +--
 config.c                 |   2 +-
 convert.c                |  12 ++--
 convert.h                |   2 +-
 diff.c                   |   6 +-
 dir.c                    |   2 +-
 entry.c                  |   4 +-
 fast-import.c            |  31 ++++-----
 fsck.c                   |   2 +-
 grep.c                   |   2 +-
 http-push.c              |   2 +-
 http-walker.c            |  16 ++---
 line-log.c               |   3 +-
 list-objects-filter.c    |   2 +-
 log-tree.c               |  12 ++--
 mailmap.c                |   2 +-
 match-trees.c            |  10 +--
 merge-blobs.c            |   4 +-
 merge-recursive.c        |  20 +++---
 notes-cache.c            |   2 +-
 notes-merge.c            |   2 +-
 notes.c                  |  10 +--
 object.c                 |  12 ++--
 pack-bitmap-write.c      |   3 +-
 pack-check.c             |   4 +-
 packfile.c               |  30 ++++-----
 pretty.c                 |   8 +--
 reachable.c              |   2 +-
 read-cache.c             |   4 +-
 ref-filter.c             |  14 ++--
 refs.c                   |   2 +-
 remote-testsvn.c         |   4 +-
 remote.c                 |   2 +-
 replace_object.c         |  26 ++++----
 rerere.c                 |   4 +-
 resolve-undo.c           |   8 +--
 resolve-undo.h           |   2 +-
 send-pack.c              |  12 ++--
 sequencer.c              |   9 +--
 sha1_file.c              | 137 ++++++++++++++++++++-------------------
 sha1_name.c              |  31 +++++----
 strbuf.c                 |   4 +-
 strbuf.h                 |   8 ++-
 streaming.c              |  18 ++---
 streaming.h              |   2 +-
 submodule-config.c       |   2 +-
 submodule.c              |   6 +-
 tag.c                    |  10 +--
 transport.c              |   6 +-
 tree-walk.c              |  45 +++++++------
 tree-walk.h              |   2 +-
 tree.c                   |  16 ++---
 tree.h                   |   2 +-
 wt-status.c              |  20 +++---
 wt-status.h              |   6 +-
 xdiff-interface.c        |   2 +-
 111 files changed, 591 insertions(+), 580 deletions(-)
Next: brian m. carlson
Message 1 of 42 in “object_id part 12”
  1. 00/36 object_id part 12brian m. carlson, Feb 25, 2018
  2. 01/36 bulk-checkin: convert index_bulk_checkin to struct object_idbrian m. carlson, Feb 25, 2018
  3. 03/36 cache-tree: convert write_*_as_tree to object_idbrian m. carlson, Feb 25, 2018
  4. 04/36 cache-tree: convert remnants to struct object_idbrian m. carlson, Feb 25, 2018
  5. Duy NguyenFeb 26, 2018
  6. 02/36 builtin/write-tree: convert to struct object_idbrian m. carlson, Feb 25, 2018
  7. 06/36 tree: convert read_tree_recursive to struct object_idbrian m. carlson, Feb 25, 2018
  8. 12/36 send-pack: convert remaining functions to struct object_idbrian m. carlson, Feb 25, 2018
  9. 13/36 replace_object: convert struct replace_object to object_idbrian m. carlson, Feb 25, 2018
  10. 14/36 builtin/mktag: convert to struct object_idbrian m. carlson, Feb 25, 2018
  11. 15/36 archive: convert write_archive_entry_fn_t to object_idbrian m. carlson, Feb 25, 2018
  12. 17/36 builtin/index-pack: convert struct ref_delta_entry to object_idbrian m. carlson, Feb 25, 2018
  13. 18/36 sha1_file: convert read_loose_object to use struct object_idbrian m. carlson, Feb 25, 2018
  14. 23/36 sha1_file: convert retry_bad_packed_offset to struct object_idbrian m. carlson, Feb 25, 2018
  15. 30/36 streaming: convert istream internals to struct object_idbrian m. carlson, Feb 25, 2018
  16. 22/36 sha1_file: convert assert_sha1_type to object_idbrian m. carlson, Feb 25, 2018
  17. 29/36 tree-walk: convert get_tree_entry_follow_symlinks internals to object_idbrian m. carlson, Feb 25, 2018
  18. 32/36 sha1_file: convert read_object_with_reference to object_idbrian m. carlson, Feb 25, 2018
  19. 35/36 sha1_file: introduce a constant for max header lengthbrian m. carlson, Feb 25, 2018
  20. 34/36 Convert lookup_replace_object to struct object_idbrian m. carlson, Feb 25, 2018
  21. Duy NguyenFeb 26, 2018
  22. 33/36 sha1_file: convert read_sha1_file to struct object_idbrian m. carlson, Feb 25, 2018
  23. 36/36 convert: convert to struct object_idbrian m. carlson, Feb 25, 2018
  24. 31/36 tree-walk: convert tree entry functions to object_idbrian m. carlson, Feb 25, 2018
  25. 28/36 builtin/notes: convert static functions to object_idbrian m. carlson, Feb 25, 2018
  26. 27/36 builtin/fmt-merge-msg: convert remaining code to object_idbrian m. carlson, Feb 25, 2018
  27. 26/36 sha1_file: convert sha1_object_info* to object_idbrian m. carlson, Feb 25, 2018
  28. 25/36 Convert remaining callers of sha1_object_info_extended to object_idbrian m. carlson, Feb 25, 2018
  29. 24/36 packfile: convert unpack_entry to struct object_idbrian m. carlson, Feb 25, 2018
  30. 21/36 builtin/mktree: convert to struct object_idbrian m. carlson, Feb 25, 2018
  31. 11/36 http-walker: convert struct object_request to use struct object_idbrian m. carlson, Feb 25, 2018
  32. 05/36 resolve-undo: convert struct resolve_undo_info to object_idbrian m. carlson, Feb 25, 2018
  33. Duy NguyenFeb 26, 2018
  34. brian m. carlsonFeb 27, 2018
  35. Duy NguyenFeb 28, 2018
  36. 20/36 streaming: convert open_istream to use struct object_idbrian m. carlson, Feb 25, 2018
  37. 19/36 sha1_file: convert check_sha1_signature to struct object_idbrian m. carlson, Feb 25, 2018
  38. 16/36 archive: convert sha1_file_to_archive to struct object_idbrian m. carlson, Feb 25, 2018
  39. 10/36 Convert find_unique_abbrev* to struct object_idbrian m. carlson, Feb 25, 2018
  40. 09/36 wt-status: convert struct wt_status_state to object_idbrian m. carlson, Feb 25, 2018
  41. 08/36 strbuf: convert strbuf_add_unique_abbrev to use struct object_idbrian m. carlson, Feb 25, 2018
  42. 07/36 ref-filter: convert grab_objectname to struct object_idbrian m. carlson, Feb 25, 2018

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.