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

Re: Giving command line parameter to textconv command?

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 15, 2009, 05:56 UTC
Message-ID
<7vfx7c3hmb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20091215121110.6117@nanako3.lavabit.com>
Nanako Shiraishi <nanako3@lavabit.com> writes:
> I experimented with other variables (eg. smudge and clean) and 
> they honor their command line arguments. If textconv is the only 
> setting that doesn't, the change may be easier to justify.

Yes, as you found out, convert.c::apply_filter() is aware of the command line arguments.

Let's try to do a bit more work to make the coverage complete. After scanning "git grep -e start_async -e run_command" output, here is what I came up with:

 - editor.c::launch_editor() that allows a custom editor named via
   GIT_EDITOR does seem to honor your command line arguments.
 - pager.c::setup_pager() is used for GIT_PAGER and it does honor your
   command line arguments.
 - ll-merge.c::ll_ext_merge() that is used to handle custom merge drivers
   lets the user specify command line via templating to replace %O %A %B
   and naturally it needs to be aware of the command line arguments.
 - diff.c::run_external_diff() that runs GIT_EXTERNAL_DIFF defines that
   the command has to take 7 parameters in a fixed order, and is not
   designed to permute its arguments like ll_ext_merge() does, but these
   days people don't use it directly (they use it indirectly via
   "difftool" wrapper), so it probably is not an issue.
 - merge-index.c::merge_entry() also defines a strict order and semantics
   to its parameters, but similar to GIT_EXTERNAL_DIFF, it is not
   something you would throw a ready-made program (like an editor or an
   pager) and expect it to work, so it wouldn't be an issue either.

Hooks do not even take arbitrary command line arguments, so we don't have to worry about them.

So it does look like that textconv is the only odd-man out.
Previous: Nanako ShiraishiNext: Jeff King
Message 4 of 33 in “Giving command line parameter to textconv command?”
  1. Nanako ShiraishiDec 14, 2009
  2. Junio C HamanoDec 14, 2009
  3. Nanako ShiraishiDec 15, 2009
  4. Junio C HamanoDec 15, 2009
  5. Jeff KingDec 15, 2009
  6. Junio C HamanoDec 16, 2009
  7. Jeff KingDec 16, 2009
  8. Jeff KingDec 15, 2009
  9. Junio C HamanoDec 15, 2009
  10. Nanako ShiraishiDec 30, 2009
  11. Junio C HamanoDec 30, 2009
  12. Jeff KingDec 30, 2009
  13. 1/6 run-command: add "use shell" optionJeff King, Dec 30, 2009
  14. Erik Faye-LundDec 30, 2009
  15. Johannes SixtJan 1, 2010
  16. 2/6 run-command: convert simple callsites to use_shellJeff King, Dec 30, 2009
  17. 3/6 run-command: optimize out useless shell callsJeff King, Dec 30, 2009
  18. Johannes SixtDec 31, 2009
  19. Junio C HamanoDec 31, 2009
  20. Johannes SixtDec 31, 2009
  21. Jeff KingDec 31, 2009
  22. Johannes SixtDec 31, 2009
  23. Jeff KingJan 1, 2010
  24. Johannes SixtJan 1, 2010
  25. 4/6 editor: use run_command's shell featureJeff King, Dec 30, 2009
  26. 5/6 textconv: use shell to run helperJeff King, Dec 30, 2009
  27. 6/6 diff: run external diff helper with shellJeff King, Dec 30, 2009
  28. 7/6 t0021: use $SHELL_PATH for the filter scriptJohannes Sixt, Jan 1, 2010
  29. 8/6 t4030, t4031: work around bogus MSYS bash path conversionJohannes Sixt, Jan 1, 2010
  30. Jeff KingJan 3, 2010
  31. Johannes SixtJan 4, 2010
  32. Jeff KingJan 4, 2010
  33. Johannes SixtJan 4, 2010

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.