From: Hui Wang <jason77.wang@gmail.com>
To: <gitster@pobox.com>, <git@vger.kernel.org>
Subject: [PATCH v2 0/1] git-clone: fix relative path problem in the alternates
Date: Mon, 22 Aug 2011 17:05:56 +0800 [thread overview]
Message-ID: <1314003957-9455-1-git-send-email-jason77.wang@gmail.com> (raw)
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 +++++++++++
next reply other threads:[~2011-08-22 9:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 9:05 Hui Wang [this message]
2011-08-22 9:05 ` [PATCH v2 1/1] clone: replace relative paths in the alternates 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314003957-9455-1-git-send-email-jason77.wang@gmail.com \
--to=jason77.wang@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).