Re: [PATCH v3] sha1_file: pass empty buffer to index empty file

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v3] sha1_file: pass empty buffer to index empty file

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:04:50

Jeff King [off-list ref] writes:
Not related to your patch, but I've often wondered if we can just get
rid of hold_lock_file_for_append. There's exactly one caller, and I
think it is doing the wrong thing. It is add_to_alternates_file(), but
shouldn't it probably read the existing lines to make sure it is not
adding a duplicate? IOW, I think hold_lock_file_for_append is a
fundamentally bad interface, because almost nobody truly wants to _just_
append.
Yeah, I tend to agree.  Perhaps I should throw it into the list of
low hanging fruits (aka lmgtfy:"git blame leftover bits") and see if
anybody bites ;-)

Re: [PATCH v3] sha1_file: pass empty buffer to index empty file

From: Jeff King <hidden>
Date: 2016-06-15 23:04:50

On Wed, May 20, 2015 at 10:25:41AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Not related to your patch, but I've often wondered if we can just get
rid of hold_lock_file_for_append. There's exactly one caller, and I
think it is doing the wrong thing. It is add_to_alternates_file(), but
shouldn't it probably read the existing lines to make sure it is not
adding a duplicate? IOW, I think hold_lock_file_for_append is a
fundamentally bad interface, because almost nobody truly wants to _just_
append.
Yeah, I tend to agree.  Perhaps I should throw it into the list of
low hanging fruits (aka lmgtfy:"git blame leftover bits") and see if
anybody bites ;-)
Good thinking. I think it is the right urgency and difficulty for that
list.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help