git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] git --trace: trace command execution

From
Junio C Hamano <junkio@cox.net>
Date
Jun 25, 2006, 11:50 UTC
Message-ID
<7v3bdtv4h3.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<E1FuSIf-0004jK-Tp@moooo.ath.cx>
Matthias Lederhofer <matled@gmx.net> writes:
Show 8 quoted lines
> Show parameters to execve/builtin-cmds before executing them. This
> version does not yet have a parameter --trace to git to enable this I
> just want to get feedback first :)
>
> I think this is quite useful to debug what is going on since a command
> may be another program (shell/python/perl/.. script etc) or just an
> alias for a internal command. Before that many commands became
> built-ins this was quite easy to do with strace.

Interesting. Debugging one's alias entries would be helped with this I would imagine, and for that you would want something like this:

> Example:
> % git showtag v1.4.1-rc1 > /dev/null
> trace: exec: /home/matled/local/stow/git/bin/git-showtag v1.4.1-rc1
> trace: exec failed: No such file or directory
* trace: expanded alias "showtag" => "cat-file tag"
> trace: built-in command: git cat-file tag v1.4.1-rc1

By the way "git cat-file -p" or "git verify-tag -v" might be more pleasant to view a tag since they make the tagger timestamp human readable.

> print_shell_escape will escape the arguments to be used as strings in
> the shell to prevent ambiguity with spaces and other special
> characters and make them copy-and-pastable.
Might be worth reusing quote.c::sq_quote(), perhaps?
Previous: Matthias LederhoferNext: Matthias Lederhofer
Message 2 of 10 in “[RFC] git --trace: trace command execution”
  1. Matthias LederhoferJun 25, 2006
  2. Junio C HamanoJun 25, 2006
  3. Matthias LederhoferJun 25, 2006
  4. GIT_TRACE: show which built-in/external commands are executedMatthias Lederhofer, Jun 25, 2006
  5. Johannes SchindelinJun 25, 2006
  6. Petr BaudisJun 25, 2006
  7. Matthias LederhoferJun 25, 2006
  8. Johannes SchindelinJun 25, 2006
  9. Matthias LederhoferJun 28, 2006
  10. Jakub NarebskiJun 29, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.