2

I can verbose the output of the git commit command by default with git config --global commit.verbose true.

This makes an entry in the .gitconfig:

[commit]
    verbose = true

I tried the same with the git add command:

[add]
    verbose = true

resp.: git config --global add.verbose true

However, this does not work (also tab-completion doesn't show me the configuration option add.verbose whereas it does for commit.verbose).

Does anybody know if there is an option to enable this function?

I am aware of work-arounds like setting aliases, but it remains a work-around and not a 100% solution.

h0ch5tr4355
  • 2,092
  • 4
  • 28
  • 51

2 Answers2

2

Strange: the need for a similar "add.verbose" config never came up in the Git mailing-list.

"commit.verbose" itself introduced in commit aaab842, May 2016, Git v2.9.0-rc0 by Pranit Bauva (pranitbauva1997), as part of the 'pb/commit-verbose-config' patch.

See commit aaab842, commit de45dbb, commit e0070e8, commit 98baeb7, commit 7d17715 (05 May 2016), and commit 36e6a5b, commit 8425b7e (12 Apr 2016) by Pranit Bauva (pranitbauva1997).
Helped-by: Junio C Hamano (gitster), and Eric Sunshine (sunshineco).
(Merged by Junio C Hamano -- gitster -- in commit 5d5f1c2, 23 May 2016)

I don't know why the same feature was not considered for git add.

So yes, alias or git script wrapper as shown here is a good alternative, but not, as you noted, a complete solution..

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I also wondered that I can't find a question for this here on SO, while I found a relating verbose question for almost any other command (git fetch, git commit, ...) I for myself find `add --verbose` most important since I often work with wildcards and want to be sure if no unwanted file has sneaked in my wildcard expression. – h0ch5tr4355 Jun 24 '19 at 10:15
  • @h0ch5tr4355 I understand. I simply to `git status` after any `git add`, and do my checks there. – VonC Jun 24 '19 at 12:06
  • Yes, I do this, too, since I mostly forget `git add -v` :-) I will accept this as this answers the question, namely there is no option to enable afore-mentioned function. – h0ch5tr4355 Jun 24 '19 at 12:09
  • 1
    @h0ch5tr4355 no option for now... that could be a future patch to be proposed in the Git mailing list ;) – VonC Jun 24 '19 at 12:10
  • I am afraid i am not versed into those mailing lists at all :D I just know them from Linux kernel development and I guess its the same with Git. – h0ch5tr4355 Jun 24 '19 at 12:12
-1

Not a direct solution, but if your main concern is to obtain concise information about your actions, you can try git add --interactive

Shweta Gupta
  • 726
  • 2
  • 6
  • 12
  • In what way curl debugging is related to `git add --verbose`? – phd Jun 24 '19 at 10:12
  • Can you explain, what this is supposed to do? – h0ch5tr4355 Jun 24 '19 at 10:12
  • @phd check - https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables: "Git uses the curl library to do network operations over HTTP, so GIT_CURL_VERBOSE tells Git to emit all the messages generated by that library. This is similar to doing curl -v on the command line." – Shweta Gupta Jun 24 '19 at 10:16
  • I know that. But I don't see any connection between curl and `git add --verbose`. `git add` doesn't use curl because it doesn't use network — it's an entirely local action. Can you explain the connection? – phd Jun 24 '19 at 10:19
  • @phd I see, my bad. That'll come handy for clone and pull commands which involves network interaction. – Shweta Gupta Jun 24 '19 at 10:28