Hi Junio, In the V2 version, i use strbuf_xxxx() to help to parse alternates file and change relative paths to absolute paths according to your suggestion, now the strbuf operations are safer. When updating new content to the lockfile, i choose to write whole content at one time instead of update it line by line. The reason is: 1. we will conditionally update the lockfile, if original alternates doesn't include relative path, we don't need to update the lockfile. This logic can't easily be handled line by line. 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, we need to add a similar function to empty and write to lockfile, and we must guarantee the first line update will call this function, then remaining update line call add_to_alternates_file(), this logic is a little complicated comparing to update whole content at one time. 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. If we choose update lockfile at one time, we can add a new function to implement this requirement and overcome all above complexity. Hui Wang (1): clone: replace relative paths in the alternates builtin/clone.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- cache.h | 1 + sha1_file.c | 11 +++++++++++ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html