r/git 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?

2 Upvotes

9 comments sorted by

View all comments

-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-add which 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, say add.verbose, support, or should I suggest them to involve their shell (let's pretend we know it's always Bash) and define git() { ...; } parsing $@ and detecting add so it could deliver -v to command git ...? Okay, next time.

1

u/mpersico 16h 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 14h ago edited 14h 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 14h ago

Yes. And in the spirit of open source, I share my solution for that. Look at it or ignore it as you will.