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

Re: [PATCH 2/3] rebase-i: slight internal improvements

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jun 20, 2008, 07:16 UTC
Message-ID
<485B595B.80608@viscovery.net>
In-Reply-To
<1213929935-15093-3-git-send-email-s-beyer@gmx.net>
Stephan Beyer schrieb:
> Add commit_message function to get the commit message
> from a commit and other slight internal improvements.
If by "other slight improvements" you mean ...
Show 11 quoted lines
>  mark_action_done () {
> -	sed -e 1q < "$TODO" >> "$DONE"
> -	sed -e 1d < "$TODO" >> "$TODO".new
> -	mv -f "$TODO".new "$TODO"
> -	count=$(grep -c '^[^#]' < "$DONE")
> -	total=$(($count+$(grep -c '^[^#]' < "$TODO")))
> +	sed -e 1q "$TODO" >>"$DONE"
> +	sed -e 1d "$TODO" >>"$TODO.new"
> +	mv -f "$TODO.new" "$TODO"
> +	count="$(grep -c '^[^#]' "$DONE")"
> +	total="$(expr "$count" + "$(grep -c '^[^#]' "$TODO")")"
... this ...
>  has_action () {
> -	grep '^[^#]' "$1" >/dev/null
> +	grep -q '^[^#]' "$1"

... and this, etc, then they are not improvements. They make the script less portable: There are 'grep's that don't have -q, others write the file name in front of the count, and I _think_ I have encountered 'sed's that don't take a file name as argument.

This patch is just code churn for which you give no convincing reason in the commit message why it is good.

-- Hannes
Previous: Stephan BeyerNext: Stephan Beyer
Message 16 of 21 in “some small changes for rebase-i”
  1. Stephan BeyerJun 20, 2008
  2. 1/3 t3404: slight improvementsStephan Beyer, Jun 20, 2008
  3. 2/3 rebase-i: slight internal improvementsStephan Beyer, Jun 20, 2008
  4. 3/3 Make rebase--interactive use OPTIONS_SPECStephan Beyer, Jun 20, 2008
  5. Stephan BeyerJun 20, 2008
  6. Johannes SchindelinJun 20, 2008
  7. 1/2 t3404: extra checks and s/! git/test_must_fail git/Stephan Beyer, Jun 20, 2008
  8. 2/2 Make rebase--interactive use OPTIONS_SPECStephan Beyer, Jun 20, 2008
  9. Brandon CaseyJun 20, 2008
  10. Stephan BeyerJun 20, 2008
  11. しらいしななこJun 20, 2008
  12. Stephan BeyerJun 21, 2008
  13. Junio C HamanoJun 21, 2008
  14. 1/2 t3404: stricter tests for git-rebase--interactiveStephan Beyer, Jun 21, 2008
  15. 2/2 Make rebase--interactive use OPTIONS_SPECStephan Beyer, Jun 21, 2008
  16. Johannes SixtJun 20, 2008
  17. Stephan BeyerJun 20, 2008
  18. Johannes SixtJun 20, 2008
  19. Johannes SchindelinJun 20, 2008
  20. Stephan BeyerJun 20, 2008
  21. Johannes SchindelinJun 20, 2008

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.