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

Re: [RFC/PATCH] status: introduce status.displayCommentChar to disable display of #

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Aug 28, 2013, 11:03 UTC
Message-ID
<521DD8EC.6050800@viscovery.net>
In-Reply-To
<1377678752-16302-1-git-send-email-Matthieu.Moy@imag.fr>
Am 8/28/2013 10:32, schrieb Matthieu Moy:
Show 17 quoted lines
> Historically, "git status" needed to prefix each output line with '#' so
> that the output could be added as comment to the commit message. This
> prefix comment has no real purpose when "git status" is ran from the
> command-line, and this may distract users from the real content.
> 
> Allow the user to disable this prefix comment. In the long run, if users
> like the non-prefix output, it may make sense to flip the default value
> to true.
> 
> Obviously, status.displayCommentChar applies to "git status" but is
> ignored by "git commit", so the status is still commented in
> COMMIT_EDITMSG.
> 
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
> As a beginner (long ago), I found this comment-prefixed output really
> weird. I got used to it,...
You have my sympathy.

How does your solution work when dirty submodules are involved and submodule status is included?

> +test_expect_success 'status with status.displayCommentChar=false' '
> +	"$PERL_PATH" -pi -e "s/^\# //; s/^\#$//; s/^#\t/\t/" expect &&

Perl's -i does not work on Windows when no backup file extension is given. Therefore, please use a temporary file or "... -pi.bak ..."

> +	git -c status.displayCommentChar=false status >output &&
> +	test_i18ncmp expect output
> +'
-- Hannes
Previous: Matthieu MoyNext: Matthieu Moy
Message 2 of 21 in “status: introduce status.displayCommentChar to disable display of #”
  1. status: introduce status.displayCommentChar to disable display of #Matthieu Moy, Aug 28, 2013
  2. Johannes SixtAug 28, 2013
  3. Matthieu MoyAug 28, 2013
  4. 1/3 builtin/stripspace.c: fix broken indentationMatthieu Moy, Aug 28, 2013
  5. 2/3 submodule: introduce --[no-]display-comment-charMatthieu Moy, Aug 28, 2013
  6. Jens LehmannAug 28, 2013
  7. Matthieu MoyAug 29, 2013
  8. 3/3 status: introduce status.displayCommentChar to disable display of #Matthieu Moy, Aug 28, 2013
  9. Junio C HamanoAug 28, 2013
  10. Junio C HamanoAug 28, 2013
  11. Jeff KingAug 28, 2013
  12. Junio C HamanoAug 28, 2013
  13. David AguilarAug 28, 2013
  14. Junio C HamanoAug 28, 2013
  15. Matthieu MoyAug 29, 2013
  16. brian m. carlsonAug 31, 2013
  17. Matthieu MoyAug 28, 2013
  18. Junio C HamanoAug 28, 2013
  19. Junio C HamanoAug 28, 2013
  20. Jonathan NiederAug 28, 2013
  21. Matthieu MoyAug 29, 2013

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.