Re: [PATCH v13 02/15] path.c: refactor relative_path(), not only strip prefix

2013-05-30 Thread Jiang Xin
2013/5/26 Jiang Xin worldhello@gmail.com: 2013/5/22 Michael Haggerty mhag...@alum.mit.edu: The old and new versions both seem to be (differently) inconsistent about when the output has a trailing slash. What is the rule? The reason for introducing patch 02/15 is that we don't want to

Re: [PATCH v13 02/15] path.c: refactor relative_path(), not only strip prefix

2013-05-25 Thread Jiang Xin
2013/5/22 Michael Haggerty mhag...@alum.mit.edu: Sorry for coming late to the party. I am on a business travel, and respond late also. ;-) On 05/22/2013 03:40 AM, Jiang Xin wrote: Different results for relative_path() before and after this refactor: abs path base path relative

Re: [PATCH v13 02/15] path.c: refactor relative_path(), not only strip prefix

2013-05-22 Thread Michael Haggerty
Sorry for coming late to the party. On 05/22/2013 03:40 AM, Jiang Xin wrote: Original design of relative_path() is simple, just strip the prefix (*base) from the absolute path (*abs). In most cases, we need a real relative path, such as: ../foo, ../../bar. That's why there is another

Re: [PATCH v13 02/15] path.c: refactor relative_path(), not only strip prefix

2013-05-22 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: Different results for relative_path() before and after this refactor: abs path base path relative (original) relative (refactor) = === === /a/b/c/ /a/b c/

[PATCH v13 02/15] path.c: refactor relative_path(), not only strip prefix

2013-05-21 Thread Jiang Xin
Original design of relative_path() is simple, just strip the prefix (*base) from the absolute path (*abs). In most cases, we need a real relative path, such as: ../foo, ../../bar. That's why there is another reimplementation (path_relative()) in quote.c. Refactor relative_path() in path.c to