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

Re: [PATCH] mergetool: Replace use of "echo -n" with printf(3) to be more portable

From
MLMatthias Lederhofer <matled@gmx.net>
Date
Mar 29, 2007, 15:57 UTC
Message-ID
<20070329155741.GA18413@moooo.ath.cx>
In-Reply-To
<11751830651770-git-send-email-tytso@mit.edu>
The subject should probably refer to printf(1) instead of printf(3).
Theodore Ts'o <tytso@mit.edu> wrote:
> -	echo -n "'$path' was deleted"
> +	printf  "'$path' was deleted"
Here is one space too much after printf.
> -	echo -n "'$path' is a symlink containing '"
> +	printf "'$path' is a symlink containing '"

You should use printf "'%s' [..]" "$path" as you do in some other places (in case $path contains conversion specifiers).

> -    echo -n "Hit return to start merge resolution tool ($merge_tool): "
> +    printf "Hit return to start merge resolution tool ($merge_tool): "

Here it is much more unlikely that $merge_tool contains a conversion specifier but anyway I'd prefer to use %s.

Previous: Randal L. SchwartzNext: Theodore Tso
Message 16 of 19 in “[GIT PULL] git mergetool fixes”
  1. Theodore Ts'oMar 29, 2007
  2. Fix minor formatting issue in man page for git-mergetoolTheodore Ts'o, Mar 29, 2007
  3. mergetool: Replace use of "echo -n" with printf(3) to be more portableTheodore Ts'o, Mar 29, 2007
  4. mergetool: Don't error out in the merge case where the local file is deletedTheodore Ts'o, Mar 29, 2007
  5. mergetool: portability fix: don't assume true is in /binTheodore Ts'o, Mar 29, 2007
  6. mergetool: portability fix: don't use reserved word functionTheodore Ts'o, Mar 29, 2007
  7. mergetool: factor out common codeTheodore Ts'o, Mar 29, 2007
  8. mergetool: Remove spurious error message if merge.tool config option not setTheodore Ts'o, Mar 29, 2007
  9. mergetool: Fix abort command when resolving symlinks and deleted filesTheodore Ts'o, Mar 29, 2007
  10. mergetool: Add support for Apple Mac OS X's opendiff commandTheodore Ts'o, Mar 29, 2007
  11. mergetool: Make git-rm quiet when resolving a deleted file conflictTheodore Ts'o, Mar 29, 2007
  12. mergetool: Clean up description of files and prompts for merge resolutionsTheodore Ts'o, Mar 29, 2007
  13. Matthias LederhoferMar 29, 2007
  14. Theodore TsoMar 30, 2007
  15. Randal L. SchwartzMar 30, 2007
  16. Matthias LederhoferMar 29, 2007
  17. Theodore TsoMar 29, 2007
  18. Junio C HamanoMar 29, 2007
  19. Theodore TsoMar 29, 2007

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.