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

[PATCH v2 0/5] sha1_file: remove only current repository can have relative path limitation

From
WHWang Hui <hui.wang@windriver.com>
Date
Sep 6, 2011, 10:24 UTC
Message-ID
<1315304645-12009-1-git-send-email-Hui.Wang@windriver.com>
Hi Junio & Martin,

In the V1, Junio said we should investigate why the limitation is originally designed. This limitation is introduced by Martin in the 2006, so add him at this time, hope he can share some information and knowledge for this question although he is not seen in the maillist recently.

Below is my investigation:

In the link_alt_odb_entry(), each alt object path will be added to the struct alternate_object_database and linked to a list, but we don't permit a same dir is added twice, otherwise it will easily introduce lots of trouble like dead-loop reference. To compare if two directories are same, original design is using memcmp() to directly compare directory path names, this method can't give a accurate result if paths include .. and multiple slash, e.g. ../../a and ../../b/../a is the same dir, but this method will report they are different. Knowing the reason, i implement a new direcotry comparison function to replace the old one, then we can safely remove multi-level relative alternates limitation now.

0001 is a simple cleanup patch, has no relation with multi-level relative limitation. 0002 is a bug fix, has no relation with multi-level relative limitation. Without this fix, all tests under t/ can work well so far, this is because we are lucky that the ent->base[pfxlen+1] is 0, if it is not 0, we will see lots of fails. After apply this fix, it is safe now. 0003 introduce a new directory comparison function to replace the old one. 0004 remove the multi-level relative alternates limitation 0005 change and add testcase to validate multi-level relative alternates.

after apply those 5 patches, all testcase under t can pass.
Hui Wang (5):
      sha1_file cleanup: remove redundant variable check
      sha1_file: remove a buggy value setting
      sha1_file: improve directories comparison method
      sha1_file: remove relative entries limitation
      t5710: add testcase for multi-level relative alternates
 abspath.c                 |   26 ++++++++++++++++++++++++++
 cache.h                   |    1 +
 sha1_file.c               |   22 +++++++---------------
 t/t5710-info-alternate.sh |   21 +++++++++++++++++++--
 4 files changed, 53 insertions(+), 17 deletions(-)
Next: Wang Hui
Message 1 of 11 in “sha1_file: remove only current repository can have relative path limitation”
  1. 0/5 sha1_file: remove only current repository can have relative path limitationWang Hui, Sep 6, 2011
  2. 1/5 sha1_file cleanup: remove redundant variable checkWang Hui, Sep 6, 2011
  3. 2/5 sha1_file: remove a buggy value settingWang Hui, Sep 6, 2011
  4. 3/5 sha1_file: improve directories comparison methodWang Hui, Sep 6, 2011
  5. 4/5 sha1_file: remove relative entries limitationWang Hui, Sep 6, 2011
  6. 5/5 t5710: add testcase for multi-level relative alternatesWang Hui, Sep 6, 2011
  7. Junio C HamanoSep 6, 2011
  8. Junio C HamanoSep 6, 2011
  9. wanghuiSep 7, 2011
  10. Junio C HamanoSep 6, 2011
  11. wanghuiSep 7, 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.