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

[PATCH 3/3] rebase --merge: adjust $((...)) coding style

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 4, 2016, 12:03 UTC
Message-ID
<6c243cf13271ed285409063e501ec67c19df767d.1454587284.git.johannes.schindelin@gmx.de>
In-Reply-To
<cover.1454587284.git.johannes.schindelin@gmx.de>

In 58634db (rebase: Allow merge strategies to be used when rebasing, 2006-06-21) we introduced $((...)) expressions containing spaces, disagreeing with Git's existing source code's convention.

Naturally, 0bb733c (Use branch names in 'git-rebase -m' conflict hunks., 2006-12-28) repeated the convention set forth in git-rebase--merge.sh.

Let's make the coding style consistent again.
Cc: Eric Wong <normalperson@yhbt.net>
Cc: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-rebase--merge.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh
index 2cc2a6d..a9bd39a 100644
--- a/git-rebase--merge.sh
+++ b/git-rebase--merge.sh
@@ -48,7 +48,7 @@ continue_merge () {
 	GIT_PAGER='' git log --format=%s -1 "$cmt"
 
 	# onto the next patch:
-	msgnum=$(($msgnum + 1))
+	msgnum=$(($msgnum+1))
 	echo "$msgnum" >"$state_dir/msgnum"
 }
 
@@ -59,7 +59,7 @@ call_merge () {
 	echo "$cmt" > "$state_dir/current"
 	hd=$(git rev-parse --verify HEAD)
 	cmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD)
-	eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"'
+	eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end-$msgnum))"'
 	eval GITHEAD_$hd='$onto_name'
 	export GITHEAD_$cmt GITHEAD_$hd
 	if test -n "$GIT_QUIET"
@@ -126,7 +126,7 @@ continue)
 skip)
 	read_state
 	git rerere clear
-	msgnum=$(($msgnum + 1))
+	msgnum=$(($msgnum+1))
 	while test "$msgnum" -le "$end"
 	do
 		call_merge "$msgnum"
@@ -144,7 +144,7 @@ write_basic_state
 msgnum=0
 for cmt in $(git rev-list --reverse --no-merges "$revisions")
 do
-	msgnum=$(($msgnum + 1))
+	msgnum=$(($msgnum+1))
 	echo "$cmt" > "$state_dir/cmt.$msgnum"
 done
 
-- 
2.7.0.windows.1.7.g55a05c8
Previous: Johannes SchindelinNext: John Keeping
Message 4 of 13 in “Fix $((...)) coding style”
  1. 0/3 Fix $((...)) coding styleJohannes Schindelin, Feb 4, 2016
  2. 1/3 filter-branch: fix style of $((...) constructJohannes Schindelin, Feb 4, 2016
  3. 2/3 rebase--interactive: adjust the coding style of $((...))Johannes Schindelin, Feb 4, 2016
  4. 3/3 rebase --merge: adjust $((...)) coding styleJohannes Schindelin, Feb 4, 2016
  5. John KeepingFeb 4, 2016
  6. Johannes SchindelinFeb 4, 2016
  7. John KeepingFeb 4, 2016
  8. Johannes SchindelinFeb 4, 2016
  9. John KeepingFeb 4, 2016
  10. Johannes SchindelinFeb 4, 2016
  11. John KeepingFeb 4, 2016
  12. Junio C HamanoFeb 4, 2016
  13. Junio C HamanoFeb 4, 2016

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.