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

Re: [PATCH 2/3] stripspace: Implement --count-lines option

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Oct 15, 2015, 16:52 UTC
Message-ID
<vpqzizkysyh.fsf@grenoble-inp.fr>
In-Reply-To
<1444911524-14504-3-git-send-email-tklauser@distanz.ch>
Tobias Klauser <tklauser@distanz.ch> writes:
Show 8 quoted lines
> --- a/Documentation/git-stripspace.txt
> +++ b/Documentation/git-stripspace.txt
> @@ -9,7 +9,7 @@ git-stripspace - Remove unnecessary whitespace
>  SYNOPSIS
>  --------
>  [verse]
> -'git stripspace' [-s | --strip-comments] < input
> +'git stripspace' [-s | --strip-comments] [-C | --count-lines] < input

I'm not sure it's a good idea to introduce a one-letter shortcut (-C). In scripts, --count-lines is self-explanatory hence more readable than -C (which is even more confusing since "git -C foo stripspace" and "git stripspace -C" have totally different meanings. Outside scripts, I'm not sure the command would be useful. I'd rather avoid polluting the one-letter-option namespace.

Show 5 quoted lines
> +Use 'git stripspace --count-lines' to obtain:
> +
> +---------
> +|5$
> +---------

In the examples above, I read the | as part of the input (unlike $ which is used only to show the end of line). So the | should not be here. I don't think you need the $ either, the --count-lines option is no longer about trailing whitespaces.

> +static const char * const usage_msg[] = {
Stick the * to usage_msg please.
No time to review the rest for now sorry.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Tobias KlauserNext: Tobias Klauser
Message 9 of 19 in “stripspace: Implement and use --count-lines option”
  1. 0/3 stripspace: Implement and use --count-lines optionTobias Klauser, Oct 15, 2015
  2. 1/3 strbuf: make stripspace() part of strbufTobias Klauser, Oct 15, 2015
  3. Matthieu MoyOct 15, 2015
  4. Tobias KlauserOct 16, 2015
  5. Matthieu MoyOct 15, 2015
  6. Junio C HamanoOct 15, 2015
  7. Tobias KlauserOct 16, 2015
  8. 2/3 stripspace: Implement --count-lines optionTobias Klauser, Oct 15, 2015
  9. Matthieu MoyOct 15, 2015
  10. Tobias KlauserOct 16, 2015
  11. Tobias KlauserOct 16, 2015
  12. Matthieu MoyOct 16, 2015
  13. Junio C HamanoOct 15, 2015
  14. Tobias KlauserOct 16, 2015
  15. Junio C HamanoOct 16, 2015
  16. Tobias KlauserOct 17, 2015
  17. Matthieu MoyOct 15, 2015
  18. Tobias KlauserOct 16, 2015
  19. 3/3 git rebase -i: Use newly added --count-lines option for stripspaceTobias Klauser, Oct 15, 2015

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.