Re: [PATCH 7/8] ls-files: support --max-depth
On Fri, Mar 28, 2014 at 9:15 PM, Duy Nguyen pclo...@gmail.com wrote: On Fri, Mar 28, 2014 at 8:52 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Duy Nguyen pclo...@gmail.com writes: I'd rather go with no trailing slash by default and add -F (which seems to be more than just '/') ... and then add a configuration variable to let users enable it by default. For GNU ls, I have alias ls='ls -F --color=auto' in my shell's configuration, but I cannot push the analogy by aliasing git ls because Git doesn't allow aliasing existing commands. I can do that but I want to push for a general solution instead of ls-only. How about config key defaults.cmd, containing a list of arguments, that will be prepended to git-cmd? Only some commands are marked to support this by adding USE_DEFAULTS in the array commands[] in git.c. And git --no-defaults cmd will ignore defaults.cmd (or git -c defaults.cmd= cmd but it's less obvious). GIT_NO_DEFAULTS can also be set, which has the same effect for all commands. Another option is to make git recognize program name gsomething and auto map it to the alias something. For example, the symlink gls will be executed as git ls (and the alias version is preferred over the builtin one). Of course you can't have alias it because git is already taken. It works for many cases, it's faster to type, and it does not break current scripts. -- Duy -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ls-files: support --max-depth
On Fri, Mar 28, 2014 at 8:52 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Duy Nguyen pclo...@gmail.com writes: I'd rather go with no trailing slash by default and add -F (which seems to be more than just '/') ... and then add a configuration variable to let users enable it by default. For GNU ls, I have alias ls='ls -F --color=auto' in my shell's configuration, but I cannot push the analogy by aliasing git ls because Git doesn't allow aliasing existing commands. I can do that but I want to push for a general solution instead of ls-only. How about config key defaults.cmd, containing a list of arguments, that will be prepended to git-cmd? Only some commands are marked to support this by adding USE_DEFAULTS in the array commands[] in git.c. And git --no-defaults cmd will ignore defaults.cmd (or git -c defaults.cmd= cmd but it's less obvious). GIT_NO_DEFAULTS can also be set, which has the same effect for all commands. -- Duy -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ls-files: support --max-depth
On Tue, Mar 25, 2014 at 6:15 PM, Duy Nguyen pclo...@gmail.com wrote: On Tue, Mar 25, 2014 at 3:55 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: - Original Message - The use case in mind is --max-depth=0 to stop recursion. With this we can do git config --global alias.ls 'ls-files --column --color --max-depth=0' and have git ls with an output very similar to GNU ls. One big difference though: your git ls does not show directories. I understand that this is easier to implement, but from the user point of view it resulted in a wtf from me running git ls in a repository containing essentially directories, and seeing just a README file in the output. I was hoping you didn't notice :) It'll be more difficult but not impossible. Ideally (for me), directories should be shown with a trailing / like ls -F does. I'd rather go with no trailing slash by default and add -F (which seems to be more than just '/') And we need a new indicator for submodules when -F is used. I think it should be different than '/'. I randomly picked '' for now. Any suggestions welcome. -- Duy -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ls-files: support --max-depth
- Original Message - The use case in mind is --max-depth=0 to stop recursion. With this we can do git config --global alias.ls 'ls-files --column --color --max-depth=0' and have git ls with an output very similar to GNU ls. One big difference though: your git ls does not show directories. I understand that this is easier to implement, but from the user point of view it resulted in a wtf from me running git ls in a repository containing essentially directories, and seeing just a README file in the output. Ideally (for me), directories should be shown with a trailing / like ls -F does. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ls-files: support --max-depth
On Tue, Mar 25, 2014 at 3:55 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: - Original Message - The use case in mind is --max-depth=0 to stop recursion. With this we can do git config --global alias.ls 'ls-files --column --color --max-depth=0' and have git ls with an output very similar to GNU ls. One big difference though: your git ls does not show directories. I understand that this is easier to implement, but from the user point of view it resulted in a wtf from me running git ls in a repository containing essentially directories, and seeing just a README file in the output. I was hoping you didn't notice :) It'll be more difficult but not impossible. Ideally (for me), directories should be shown with a trailing / like ls -F does. I'd rather go with no trailing slash by default and add -F (which seems to be more than just '/') -- Duy -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html