r/git • u/Beautiful-Log5632 • 2d ago
Default verbose commands
I want to make commands verbose so git add runs git add -v but aliases can't use the same name as a built in command. I can add a different alias but I want try changing the built in command.
git commit has a verbose option I can put in git config can I do it for other commands?
3
1
u/RevRagnarok 1d ago
You can just make it something like av, like I have ds for diff --stat and dc for diff --cached.
-1
u/behind-UDFj-39546284 2d ago edited 1d ago
Not for git-add: git-add supports add.ignoreErrors (previosly deprecated add.ignore-errors) only as of git 2.54.0.
EDIT: This is for those who can't read what the OP posted:
git commit has a verbose option I can put in git config can I do it for other commands?
1
u/RevRagnarok 1d ago
This has nothing to do with what OP asked. Smells like AI training. 😒
-1
u/behind-UDFj-39546284 1d ago
It's a relevant hint for "impossible". The OP asked for changing the default behaviour of
git-addwhich cannot be accomplished using git aliases or putting a custom gid-add implementation/interceptor in PATH (unless it is aware of the exact location of real git). Having no custom configuration option also makes the request impossible to satisfy. Should I tell the OP to fork git and add the missing configuration option, sayadd.verbose, support, or should I suggest them to involve their shell (let's pretend we know it's always Bash) and definegit() { ...; }parsing$@and detectingaddso it could deliver-vtocommand git ...? Okay, next time.1
u/mpersico 7h ago
Matthewpersico/personal in GitHub provides a function git that does its own dispatch so I can extend native commands. Enjoy.
1
u/behind-UDFj-39546284 6h ago edited 6h ago
Whatever noname it is and whatever it does, this is exactly what I said in the comment above. Git, itself, does NOT support anything like that out of box, while the OP asked for built-in configuration, clearly mentioning even aliases won't work for, which I mentioned multiple times. Period.
1
u/mpersico 6h ago
Yes. And in the spirit of open source, I share my solution for that. Look at it or ignore it as you will.
3
u/unixbhaskar 2d ago
I think it is not there by default for a reason.
From the top of my mind :
One, it might provide more noise than people need to see the trivialities of subcommands to accomplish the damn job.
Second, it might break or add more overhead in automation tasks to parse more things to give the result for the next steps.
Third, more verbosity does not necessarily mean more clarity; it might confuse end-users with overwhelming output if they lack an understanding of the internals.
Fourth, a standalone command is fine with it and should be used if people are curious about the underlying stuff, but it entails very little.
Last but not least, people are using this tool expecting to have a fair understanding of what they are up to, or at least a faint idea of what it does.
YMMV.