git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] clone-local fixup

From
HWHui Wang <jason77.wang@gmail.com>
Date
Aug 23, 2011, 03:43 UTC
Message-ID
<4E5321C9.4080301@gmail.com>
In-Reply-To
<1314061516-24964-1-git-send-email-gitster@pobox.com>
This patch series solved the problem from the root cause. :-)

But there is a little problem in the second patch, i provide an incremental patch basing on your second patch, if it is fine to you, it is OK to squash this patch to your second patch.

commit 47e890818fdac5f6493cd0bbaf9da350785a2bca
Author: Hui Wang <jason77.wang@gmail.com>
Date:   Tue Aug 23 11:32:26 2011 +0800
    clone: don't change absolute path in the copy_alternates
   
    The source alternates may include empty lines, comment lines, relative
    paths and absolute paths. Absolute paths don't need to be changed
    before added to the destination alternates.
   
    Signed-off-by: Hui Wang <jason77.wang@gmail.com>
diff --git a/builtin/clone.c b/builtin/clone.c
index 2842707..284e325 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -258,6 +258,10 @@ static void copy_alternates(struct strbuf *src, 
struct strbuf *dst,
                char *abs_path, abs_buf[PATH_MAX];
                if (!line.len || line.buf[0] == '#')
                        continue;
+               if (is_absolute_path(line.buf)) {
+                       add_to_alternates_file(line.buf);
+                       continue;
+               }
                abs_path = mkpath("%s/objects/%s", src_repo, line.buf);
                normalize_path_copy(abs_buf, abs_path);
                add_to_alternates_file(abs_buf);


Regards,
Hui.

Junio C Hamano wrote:
> So I ended up tackling this myself. I didn't bother moving the
> add_to_alternates_file(), though.
>
> Junio C Hamano (2):
>   clone: allow more than one --reference
>   clone: clone from a repository with relative alternates
>
>  builtin/clone.c  |   82 +++++++++++++++++++++++++++++++++++++++++------------
>  sha1_file.c      |    2 +-
>  t/t5601-clone.sh |   23 +++++++++++++++
>  3 files changed, 87 insertions(+), 20 deletions(-)
>
>   
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 10 in “git-clone: fix relative path problem in the alternates”
  1. 0/1 git-clone: fix relative path problem in the alternatesHui Wang, Aug 22, 2011
  2. 1/1 clone: replace relative paths in the alternatesHui Wang, Aug 22, 2011
  3. Junio C HamanoAug 22, 2011
  4. Junio C HamanoAug 22, 2011
  5. Junio C HamanoAug 22, 2011
  6. 0/2 clone-local fixupJunio C Hamano, Aug 23, 2011
  7. 1/2 clone: allow more than one --referenceJunio C Hamano, Aug 23, 2011
  8. 2/2 clone: clone from a repository with relative alternatesJunio C Hamano, Aug 23, 2011
  9. Hui WangAug 23, 2011
  10. Junio C HamanoAug 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.