git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] git-clone: fix relative path problem in the alternates
@ 2011-08-22  9:05 Hui Wang
  2011-08-22  9:05 ` [PATCH v2 1/1] clone: replace relative paths " Hui Wang
  2011-08-22 19:10 ` [PATCH v2 0/1] git-clone: fix relative path problem " Junio C Hamano
  0 siblings, 2 replies; 10+ messages in thread
From: Hui Wang @ 2011-08-22  9:05 UTC (permalink / raw)
  To: gitster, git


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 +++++++++++

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-08-23 16:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22  9:05 [PATCH v2 0/1] git-clone: fix relative path problem in the alternates Hui Wang
2011-08-22  9:05 ` [PATCH v2 1/1] clone: replace relative paths " Hui Wang
2011-08-22 19:10 ` [PATCH v2 0/1] git-clone: fix relative path problem " Junio C Hamano
2011-08-22 20:38   ` Junio C Hamano
2011-08-22 21:57     ` Junio C Hamano
2011-08-23  1:05       ` [PATCH 0/2] clone-local fixup Junio C Hamano
2011-08-23  1:05         ` [PATCH 1/2] clone: allow more than one --reference Junio C Hamano
2011-08-23  1:05         ` [PATCH 2/2] clone: clone from a repository with relative alternates Junio C Hamano
2011-08-23  3:43         ` [PATCH 0/2] clone-local fixup Hui Wang
2011-08-23 16:26           ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).