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

[PATCH 0/8] object_id part 2

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 9, 2015, 16:28 UTC
Message-ID
<1433867316-663554-1-git-send-email-sandals@crustytoothpaste.net>
This is another series of conversions to struct object_id.

This series converts more of the refs code and struct object to use struct object_id. It introduces two additional helper functions. One is has_object_file, which is the equivalent of has_sha1_file. The name was chosen to be slightly more logical than has_oid_file, although it can be changed if desired.

The second helper function is parse_oid_hex. It works much like get_oid_hex, but it takes an optional length argument and returns the number of bytes parsed on success (40) and 0 on error. It's designed to be more useful in conditionals and to enable us to avoid having to write GIT_SHA1_HEXSZ in favor of simply using the return value.

The final piece in this series is the conversion of struct object to use struct object_id. This is a necessarily large patch because of the large number of places this code is used.

brian m. carlson (8):
  refs: convert some internal functions to use object_id
  sha1_file: introduce has_object_file helper.
  Convert struct ref to use object_id.
  Add a utility function to make parsing hex values easier.
  add_sought_entry_mem: convert to struct object_id
  parse_fetch: convert to use struct object_id
  ref_newer: convert to use struct object_id
  Convert struct object to object_id
 archive.c                |   6 +--
 bisect.c                 |  10 ++---
 branch.c                 |   2 +-
 builtin/blame.c          |  46 ++++++++++----------
 builtin/branch.c         |   2 +-
 builtin/checkout.c       |  24 +++++------
 builtin/clone.c          |  18 ++++----
 builtin/commit-tree.c    |   4 +-
 builtin/commit.c         |   8 ++--
 builtin/describe.c       |  20 ++++-----
 builtin/diff-tree.c      |  12 +++---
 builtin/diff.c           |  12 +++---
 builtin/fast-export.c    |  34 +++++++--------
 builtin/fetch-pack.c     |  14 ++++---
 builtin/fetch.c          |  54 ++++++++++++------------
 builtin/fmt-merge-msg.c  |   6 +--
 builtin/for-each-ref.c   |  12 +++---
 builtin/fsck.c           |  34 +++++++--------
 builtin/grep.c           |   6 +--
 builtin/index-pack.c     |  10 ++---
 builtin/log.c            |  24 +++++------
 builtin/ls-remote.c      |   2 +-
 builtin/merge-base.c     |   8 ++--
 builtin/merge-tree.c     |   6 +--
 builtin/merge.c          |  60 +++++++++++++--------------
 builtin/name-rev.c       |  12 +++---
 builtin/notes.c          |   2 +-
 builtin/pack-objects.c   |  16 +++----
 builtin/receive-pack.c   |   2 +-
 builtin/reflog.c         |   4 +-
 builtin/remote.c         |  12 +++---
 builtin/replace.c        |   2 +-
 builtin/reset.c          |   6 +--
 builtin/rev-list.c       |  18 ++++----
 builtin/rev-parse.c      |   4 +-
 builtin/shortlog.c       |   2 +-
 builtin/show-branch.c    |   8 ++--
 builtin/tag.c            |   4 +-
 builtin/unpack-objects.c |  10 ++---
 bundle.c                 |  10 ++---
 cache-tree.c             |   2 +-
 cache.h                  |  12 ++++++
 combine-diff.c           |   4 +-
 commit.c                 |  32 +++++++-------
 connect.c                |   2 +-
 decorate.c               |   2 +-
 diff-lib.c               |   2 +-
 fetch-pack.c             |  24 +++++------
 fsck.c                   |  10 ++---
 hex.c                    |   7 ++++
 http-backend.c           |   2 +-
 http-push.c              |  88 +++++++++++++++++++--------------------
 http.c                   |   2 +-
 line-log.c               |   6 +--
 list-objects.c           |   4 +-
 log-tree.c               |  32 +++++++-------
 merge-blobs.c            |   4 +-
 merge-recursive.c        |  22 +++++-----
 merge.c                  |   2 +-
 notes-merge.c            |  24 +++++------
 object.c                 |   8 ++--
 object.h                 |   2 +-
 pack-bitmap-write.c      |  16 +++----
 pack-bitmap.c            |  34 +++++++--------
 patch-ids.c              |   6 +--
 pretty.c                 |  18 ++++----
 refs.c                   | 106 +++++++++++++++++++++++------------------------
 remote-curl.c            |  21 +++++-----
 remote.c                 |  68 +++++++++++++++---------------
 remote.h                 |   8 ++--
 revision.c               |  48 ++++++++++-----------
 send-pack.c              |  16 +++----
 sequencer.c              |  38 ++++++++---------
 server-info.c            |   2 +-
 sha1_file.c              |   5 +++
 sha1_name.c              |  20 ++++-----
 shallow.c                |   6 +--
 submodule.c              |   8 ++--
 tag.c                    |  10 ++---
 test-match-trees.c       |   2 +-
 transport-helper.c       |  18 ++++----
 transport.c              |  32 +++++++-------
 transport.h              |   8 ++--
 tree.c                   |  10 ++---
 upload-pack.c            |  26 ++++++------
 walker.c                 |  18 ++++----
 wt-status.c              |   2 +-
 87 files changed, 706 insertions(+), 679 deletions(-)
-- 
2.4.0
Next: brian m. carlson
Message 1 of 23 in “object_id part 2”
  1. 0/8 object_id part 2brian m. carlson, Jun 9, 2015
  2. 1/8 refs: convert some internal functions to use object_idbrian m. carlson, Jun 9, 2015
  3. 2/8 sha1_file: introduce has_object_file helper.brian m. carlson, Jun 9, 2015
  4. Duy NguyenJun 10, 2015
  5. brian m. carlsonJun 10, 2015
  6. 3/8 Convert struct ref to use object_id.brian m. carlson, Jun 9, 2015
  7. Michael HaggertyJun 11, 2015
  8. 4/8 Add a utility function to make parsing hex values easier.brian m. carlson, Jun 9, 2015
  9. Michael HaggertyJun 11, 2015
  10. 5/8 add_sought_entry_mem: convert to struct object_idbrian m. carlson, Jun 9, 2015
  11. 6/8 parse_fetch: convert to use struct object_idbrian m. carlson, Jun 9, 2015
  12. 7/8 ref_newer: convert to use struct object_idbrian m. carlson, Jun 9, 2015
  13. Junio C HamanoJun 10, 2015
  14. brian m. carlsonJun 10, 2015
  15. brian m. carlsonJun 11, 2015
  16. Junio C HamanoJun 11, 2015
  17. brian m. carlsonJun 11, 2015
  18. Junio C HamanoJun 11, 2015
  19. brian m. carlsonJun 12, 2015
  20. Junio C HamanoJun 12, 2015
  21. brian m. carlsonJun 12, 2015
  22. Michael HaggertyJun 13, 2015
  23. brian m. carlsonJun 13, 2015

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.