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

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

From
Tobias Klauser <tklauser@distanz.ch>
Date
Oct 17, 2015, 10:44 UTC
Message-ID
<20151017104425.GF2468@distanz.ch>
In-Reply-To
<xmqq8u72g1hm.fsf@gitster.mtv.corp.google.com>
On 2015-10-16 at 19:35:49 +0200, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Tobias Klauser <tklauser@distanz.ch> writes:
> 
> >> So this is your output code, which gives only the number of lines
> >> without the cleaned up result.
> >
> > This should better be a simple printf("%zu\n", lines) I guess?
> 
> I think we actively avoid using %z conversion that is only C99.
> 
> If you really want to, you could count in size_t and use %lu with
> appropriate casting, which I think is what we do in the rest of the
> codebase.
> 
> For this one, I think it is sufficient to just count in int and
> print as int with %d, though.
Ok, will use an int to count and printf("%d\n").
Previous: Junio C HamanoNext: Matthieu Moy
Message 16 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.