Re: command for relative path

2011-11-14 Thread Peng Yu
2011/11/14 Pádraig Brady : > On 11/14/2011 01:46 PM, Peng Yu wrote: >>> However, please do us (and yourself) a favor by reading and applying >>> the guidelines in HACKING before posting your patch. >> >> I had committed more than one times. The following command only shows >> the latest commit. How

Re: command for relative path

2011-11-14 Thread Pádraig Brady
On 11/14/2011 01:46 PM, Peng Yu wrote: >> However, please do us (and yourself) a favor by reading and applying >> the guidelines in HACKING before posting your patch. > > I had committed more than one times. The following command only shows > the latest commit. How to get the diff for all the chan

Re: command for relative path

2011-11-14 Thread Peng Yu
> However, please do us (and yourself) a favor by reading and applying > the guidelines in HACKING before posting your patch. I had committed more than one times. The following command only shows the latest commit. How to get the diff for all the changes that I made? ~/coreutils$ git format-patch

Re: command for relative path

2011-11-14 Thread Bjartur Thorlacius
On 11/13/11, Dmitry V. Levin wrote: > On Sun, Nov 13, 2011 at 07:47:39PM +, Bjartur Thorlacius wrote: >> I'd prefer a new utility packaged along with an existing realpath >> utility, > > By talking about an existing realpath utility you certainly do not mean > an utility from GNU coreutils. >

Re: command for relative path

2011-11-13 Thread Jim Meyering
Peng Yu wrote: >> would you care to submit a patch? > > I have finished relpath.c. When I push it (after commit), I get the > following error. I'm new to git. Does anybody know what the problem > is? And how to get my patch to the central git repository? > > ~/coreutils$ git push > fatal: The remot

Re: command for relative path

2011-11-13 Thread Bob Proulx
Peng Yu wrote: > > would you care to submit a patch? > > I have finished relpath.c. When I push it (after commit), I get the > following error. I'm new to git. Does anybody know what the problem > is? And how to get my patch to the central git repository? > > ~/coreutils$ git push > fatal: The re

Re: command for relative path

2011-11-13 Thread Peng Yu
> would you care to submit a patch? Hi, I have finished relpath.c. When I push it (after commit), I get the following error. I'm new to git. Does anybody know what the problem is? And how to get my patch to the central git repository? ~/coreutils$ git push fatal: The remote end hung up unexpecte

Re: command for relative path

2011-11-13 Thread Dmitry V. Levin
On Sun, Nov 13, 2011 at 07:47:39PM +, Bjartur Thorlacius wrote: > On 11/13/11, Dmitry V. Levin wrote: > > AFAIR the coreutils' realpath is called readlink. ;) > > > Except readlink currently doesn't work for symlinks, as it insists on > following them before canonicalizing pathnames. Unfortuna

Re: command for relative path

2011-11-13 Thread Dmitry V. Levin
On Sun, Nov 13, 2011 at 04:41:14PM -0600, Peng Yu wrote: > On Sun, Nov 13, 2011 at 12:45 PM, Dmitry V. Levin wrote: > > On Sat, Nov 12, 2011 at 11:45:56AM -0700, Eric Blake wrote: > > [...] > >> http://docs.python.org/library/os.path.html > >> >> os.path.relpath(path[, start]) > >> >> > >> >>     R

Re: command for relative path

2011-11-13 Thread Peng Yu
On Sun, Nov 13, 2011 at 12:45 PM, Dmitry V. Levin wrote: > Hi, > > On Sat, Nov 12, 2011 at 11:45:56AM -0700, Eric Blake wrote: > [...] >> http://docs.python.org/library/os.path.html >> >> os.path.relpath(path[, start]) >> >> >> >>     Return a relative filepath to path either from the current dire

Re: command for relative path

2011-11-13 Thread Bjartur Thorlacius
On 11/13/11, Dmitry V. Levin wrote: > AFAIR the coreutils' realpath is called readlink. ;) > Except readlink currently doesn't work for symlinks, as it insists on following them before canonicalizing pathnames. > Would "readlink --relative" or something like this be a good choice? > Or should it

Re: command for relative path

2011-11-13 Thread Dmitry V. Levin
Hi, On Sat, Nov 12, 2011 at 11:45:56AM -0700, Eric Blake wrote: [...] > http://docs.python.org/library/os.path.html > >> os.path.relpath(path[, start]) > >> > >> Return a relative filepath to path either from the current directory > >> or from an optional start point. > > Ah, so the idea is

Re: command for relative path

2011-11-13 Thread Bjartur Thorlacius
On 11/12/11, Peng Yu wrote: > On Sat, Nov 12, 2011 at 2:41 PM, Bjartur Thorlacius > wrote: > I don't see how realpath can do what I want. relpath.py gives me the > relative path of a from b. But realpath doesn't do so. > Sorry, my statement was completely false. Realpath -s is but a first step to

Re: command for relative path

2011-11-12 Thread Peng Yu
On Sat, Nov 12, 2011 at 2:41 PM, Bjartur Thorlacius wrote: > On Sat, 12 Nov 2011 20:20:57 -, Peng Yu wrote: >> >> Should this be added to an existing coreutils' command or add a new >> command to coreutils? Personally I'd prefer to add a command called >> relpath. But I'm not sure the standar

Re: command for relative path

2011-11-12 Thread Bjartur Thorlacius
On Sat, 12 Nov 2011 20:20:57 -, Peng Yu wrote: Should this be added to an existing coreutils' command or add a new command to coreutils? Personally I'd prefer to add a command called relpath. But I'm not sure the standard organization in coreutils. There is already an utility called realpat

Re: command for relative path

2011-11-12 Thread Peng Yu
On Sat, Nov 12, 2011 at 12:45 PM, Eric Blake wrote: > On 11/12/2011 09:16 AM, Peng Yu wrote: >> Hi, >> >> coreutils can give abspaths ('readlink -f -e'). But I'm not able to >> find a command for relative paths. > > I had to go chase down python documentation to see what you wanted, > since you di

Re: command for relative path

2011-11-12 Thread Eric Blake
On 11/12/2011 09:16 AM, Peng Yu wrote: > Hi, > > coreutils can give abspaths ('readlink -f -e'). But I'm not able to > find a command for relative paths. I had to go chase down python documentation to see what you wanted, since you didn't give an example: > > print os.path.relpath(path, start)

command for relative path

2011-11-12 Thread Peng Yu
Hi, coreutils can give abspaths ('readlink -f -e'). But I'm not able to find a command for relative paths. I use the following python script to do so. The drawback is that it is dependent on python (meaning it is less portable). But I'm wondering if it is possible to add such a command (or an opti