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

[PATCH 1/4] difftool--helper: Make style consistent with git

From
David Aguilar <davvid@gmail.com>
Date
Aug 18, 2011, 07:23 UTC
Message-ID
<1313652227-48545-2-git-send-email-davvid@gmail.com>
In-Reply-To
<1313652227-48545-1-git-send-email-davvid@gmail.com>

Use the predominant conditional style where "then" appears alone on the line after the test expression.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-difftool--helper.sh |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 0594bf7..8452890 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -13,7 +13,8 @@ TOOL_MODE=diff
 should_prompt () {
 	prompt_merge=$(git config --bool mergetool.prompt || echo true)
 	prompt=$(git config --bool difftool.prompt || echo $prompt_merge)
-	if test "$prompt" = true; then
+	if test "$prompt" = true
+	then
 		test -z "$GIT_DIFFTOOL_NO_PROMPT"
 	else
 		test -n "$GIT_DIFFTOOL_PROMPT"
@@ -37,9 +38,11 @@ launch_merge_tool () {
 
 	# $LOCAL and $REMOTE are temporary files so prompt
 	# the user with the real $MERGED name before launching $merge_tool.
-	if should_prompt; then
+	if should_prompt
+	then
 		printf "\nViewing: '$MERGED'\n"
-		if use_ext_cmd; then
+		if use_ext_cmd
+		then
 			printf "Hit return to launch '%s': " \
 				"$GIT_DIFFTOOL_EXTCMD"
 		else
@@ -48,7 +51,8 @@ launch_merge_tool () {
 		read ans
 	fi
 
-	if use_ext_cmd; then
+	if use_ext_cmd
+	then
 		export BASE
 		eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
 	else
@@ -56,8 +60,10 @@ launch_merge_tool () {
 	fi
 }
 
-if ! use_ext_cmd; then
-	if test -n "$GIT_DIFF_TOOL"; then
+if ! use_ext_cmd
+then
+	if test -n "$GIT_DIFF_TOOL"
+	then
 		merge_tool="$GIT_DIFF_TOOL"
 	else
 		merge_tool="$(get_merge_tool)" || exit
-- 
1.7.6.476.g57292
Previous: David AguilarNext: Sebastian Schuberth
Message 2 of 18 in “Refactor git-mergetool--lib.sh”
  1. 0/4 Refactor git-mergetool--lib.shDavid Aguilar, Aug 18, 2011
  2. 1/4 difftool--helper: Make style consistent with gitDavid Aguilar, Aug 18, 2011
  3. Sebastian SchuberthAug 18, 2011
  4. David AguilarAug 18, 2011
  5. Junio C HamanoAug 18, 2011
  6. 2/4 mergetool--lib: Make style consistent with gitDavid Aguilar, Aug 18, 2011
  7. 3/4 mergetool--lib: Refactor tools into separate filesDavid Aguilar, Aug 18, 2011
  8. Makefile: fix permissions of mergetools/ checked out with permissive umaskJonathan Nieder, Oct 9, 2011
  9. Jonathan NiederOct 9, 2011
  10. David AguilarOct 9, 2011
  11. Jonathan NiederOct 9, 2011
  12. Junio C HamanoOct 11, 2011
  13. 4/4 mergetools/meld: Use '--output' when availableDavid Aguilar, Aug 18, 2011
  14. Jonathan NiederAug 18, 2011
  15. David AguilarAug 18, 2011
  16. 4/4 mergetools/meld: Use '--output' when availableDavid Aguilar, Aug 19, 2011
  17. Junio C HamanoAug 19, 2011
  18. Sebastian SchuberthAug 18, 2011

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.