Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2 0/1] git-clone: fix relative path problem in the alternates

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:51

Hui Wang [off-list ref] writes:
2. current git system only provides add_to_alternates_file()in the sha1_file.c
to update lockfile, this function can add a line to lockfile but can't empty
and write lockfile,
I do not see the need for "empty and write" in the first place. You are
spending cycles to go through all the lines in the input, inspecting and
holding the replacement somewhere, it is a one-time cost for cloning, and
the alternates file wouldn't be humongous anyway, so I do not see the need
for "we don't touch if there is no relative path in the file" if it makes
the code more complex than a stupid "one line at a time" approach.
3. current existing add_to_alternates_file() will unconditionally append
"/objects" at each new added line, that need us to parse and  remove
"/objects" from each line read out from source alternates, this is a little
bit complicated.
Clone with --reference is the only other caller of that function; I would
say it is perfectly fine to make it the caller's responsibility to append
"/objects" if that makes the resulting code easier to maintain.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help