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

Re: [PATCH 3/6] rebase: trivial style fixes

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 31, 2013, 03:49 UTC
Message-ID
<xmqqbo4ewmd4.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1377899810-1818-4-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 27 quoted lines
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  git-rebase.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/git-rebase.sh b/git-rebase.sh
> index 8d7659a..2c02853 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -324,7 +324,7 @@ done
>  test $# -gt 2 && usage
>  
>  if test -n "$cmd" &&
> -   test "$interactive_rebase" != explicit
> +	test "$interactive_rebase" != explicit
>  then
>  	die "$(gettext "The --exec option must be used with the --interactive option")"
>  fi
> @@ -486,7 +486,7 @@ case "$#" in
>  	switch_to="$1"
>  
>  	if git show-ref --verify --quiet -- "refs/heads/$1" &&
> -	   orig_head=$(git rev-parse -q --verify "refs/heads/$1")
> +		orig_head=$(git rev-parse -q --verify "refs/heads/$1")
>  	then
>  		head_name="refs/heads/$1"
>  	elif orig_head=$(git rev-parse -q --verify "$1")

I am not sure about this change. I do not personally have strong preference on this, but it would be better to be consistent.

The style of the original we see above seems to be the one that is consistently used in this file for conditionals that span multiple lines. That is, to align the beginning of subsequent lines with the beginning of the conditional (i.e. the "g" in "git show-ref" on the first line)---which happens to be in line with what we use in our C sources, too.

I see there is one oddball in that file, though.
 git-rebase.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 8d7659a..187793e 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -422,7 +422,7 @@ then
 	case "$#" in
 	0)
 		if ! upstream_name=$(git rev-parse --symbolic-full-name \
-			--verify -q @{upstream} 2>/dev/null)
+		   --verify -q @{upstream} 2>/dev/null)
 		then
 			. git-parse-remote
 			error_on_missing_default_upstream "rebase" "rebase" \
Previous: Felipe ContrerasNext: Felipe Contreras
Message 7 of 26 in “Trivial cleanups and fixes”
  1. 0/6 Trivial cleanups and fixesFelipe Contreras, Aug 30, 2013
  2. 1/6 reset: trivial refactoringFelipe Contreras, Aug 30, 2013
  3. Junio C HamanoAug 31, 2013
  4. 2/6 branch: trivial style fixFelipe Contreras, Aug 30, 2013
  5. Junio C HamanoAug 31, 2013
  6. 3/6 rebase: trivial style fixesFelipe Contreras, Aug 30, 2013
  7. Junio C HamanoAug 31, 2013
  8. 4/6 reset: trivial style cleanupFelipe Contreras, Aug 30, 2013
  9. Junio C HamanoAug 31, 2013
  10. 5/6 add: trivial style cleanupFelipe Contreras, Aug 30, 2013
  11. Junio C HamanoAug 31, 2013
  12. 6/6 pull: trivial cleanupFelipe Contreras, Aug 30, 2013
  13. Junio C HamanoAug 31, 2013
  14. Felipe ContrerasAug 31, 2013
  15. branch: use $curr_branch_short moreRené Scharfe, Aug 31, 2013
  16. Felipe ContrerasAug 31, 2013
  17. René ScharfeAug 31, 2013
  18. Felipe ContrerasAug 31, 2013
  19. René ScharfeAug 31, 2013
  20. Felipe ContrerasAug 31, 2013
  21. René ScharfeSep 8, 2013
  22. Felipe ContrerasSep 8, 2013
  23. René ScharfeSep 15, 2013
  24. Felipe ContrerasSep 15, 2013
  25. Junio C HamanoSep 3, 2013
  26. pull: use $curr_branch_short moreRené Scharfe, Sep 8, 2013

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.