Skip to content

Modernize read_graft_line implementation

Patryk Obara git 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 4 repliesIn review
  2. v34 patches 11 repliesSuperseded
  3. v24 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches20 repliesSuperseded

Changes in v4 from the cover letter

- Commit replacing raw buffer does not store temporary pointer to strbuf internals any more.

- Commit message of patch 4 explains all alternative approaches considered so far.

- Patch 4 uses two-phases to parse graft line, without code repetition.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4sha1_file: fix definition of null_sha1sha1_file.c+1 -10 replies
2/4commit: replace the raw buffer with strbuf in read_graft_linebuiltin/blame.c commit.c commit.h+13 -140 replies
3/4commit: allocate array using object_id sizecommit.c+2 -10 replies
4/4commit: rewrite read_graft_linecommit.c+20 -154 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/4] Modernize read_graft_line implementation

Changes since v3:

- Commit replacing raw buffer does not store temporary pointer to strbuf internals any more.

- Commit message of patch 4 explains all alternative approaches considered so far.

- Patch 4 uses two-phases to parse graft line, without code repetition.

I have my reservations about patch 4 from readability standpoint (it's not immediately clear why parsing code can skip freeing of graft in phase 2), but this implementation seems to address every issue raised in review so far. If you'll prefer me to go back to impementation from v3, I have it prepared ;)

Patryk Obara (4):
sha1_file: fix definition of null_sha1
commit: replace the raw buffer with strbuf in read_graft_line
commit: allocate array using object_id size
commit: rewrite read_graft_line

 builtin/blame.c |  2 +-
 commit.c        | 45 +++++++++++++++++++++++++--------------------
 commit.h        |  2 +-
 sha1_file.c     |  2 +-
 4 files changed, 28 insertions(+), 23 deletions(-)
Signature · 1 line
2.9.5