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

2013-05-29 Thread Jiang Xin
2013/5/26 Jiang Xin : > 2013/5/22 Michael Haggerty : > >> 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 reinvent > the wheel. Patch 06/15 (git-

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 : > 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 (original) relati

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

2013-05-22 Thread Junio C Hamano
Michael Haggerty 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/ c/ >>

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

[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 retur