Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-17 Thread Patryk Obara
> In fact, the former is already how we represent the list of fake > parents in the commit_graft structure, so I think patch 5/5 in this > series does two unrelated things, one of which is bad (i.e. use of > parse_oid_hex() is good; turning the FLEX_ARRAY at the end into a > oid_array that

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-17 Thread Junio C Hamano
Jeff King writes: > I'd expect most of the GIT_MAX constants to eventually go away in favor > of "struct object_id", but that will still be using the same "big enough > to hold any hash" size under the hood. Indeed. It is good to see major contributors are in agreement ;-) I'd

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-16 Thread Jeff King
On Wed, Aug 16, 2017 at 10:59:02PM +, brian m. carlson wrote: > On Wed, Aug 16, 2017 at 02:24:27PM +0200, Patryk Obara wrote: > > On Tue, Aug 15, 2017 at 7:02 PM, Stefan Beller wrote: > > >> const int entry_size = GIT_SHA1_HEXSZ + 1; > > > > > > outside the scope

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-16 Thread brian m. carlson
On Wed, Aug 16, 2017 at 02:24:27PM +0200, Patryk Obara wrote: > On Tue, Aug 15, 2017 at 7:02 PM, Stefan Beller wrote: > >> const int entry_size = GIT_SHA1_HEXSZ + 1; > > > > outside the scope of this patch: > > Is GIT_SHA1_HEXSZ or GIT_MAX_HEXSZ the right call here? >

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-16 Thread Patryk Obara
On Tue, Aug 15, 2017 at 7:02 PM, Stefan Beller wrote: >> const int entry_size = GIT_SHA1_HEXSZ + 1; > > outside the scope of this patch: > Is GIT_SHA1_HEXSZ or GIT_MAX_HEXSZ the right call here? I think neither one. In my opinion, this code should not be so closely

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-15 Thread Junio C Hamano
Patryk Obara writes: > This simplifies function declaration and allows for use of strbuf_rtrim > instead of modifying buffer directly. > > Signed-off-by: Patryk Obara > --- > builtin/blame.c | 2 +- > commit.c| 11 ++- > commit.h

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-15 Thread Stefan Beller
On Tue, Aug 15, 2017 at 4:49 AM, Patryk Obara wrote: > This simplifies function declaration and allows for use of strbuf_rtrim > instead of modifying buffer directly. > > Signed-off-by: Patryk Obara > --- > builtin/blame.c | 2 +- > commit.c

[PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-15 Thread Patryk Obara
This simplifies function declaration and allows for use of strbuf_rtrim instead of modifying buffer directly. Signed-off-by: Patryk Obara --- builtin/blame.c | 2 +- commit.c| 11 ++- commit.h| 2 +- 3 files changed, 8 insertions(+), 7