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

[PATCH 2/2] git-commit: make '-a' the default.

From
Junio C Hamano <junkio@cox.net>
Date
Nov 28, 2006, 07:00 UTC
Message-ID
<7vy7pw5a4d.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vk61gcnzl.fsf@assigned-by-dhcp.cox.net>

At the same time, stop talking about "--only" option being the default when given paths. It has been that way for quite some time.

This change breaks t1400 which assumed the long tradition of not modifying index when not told to touch it with an explicit -a nor paths, so this commit includes adjustment for it as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-commit.sh         |   13 ++++++-------
 t/t1400-update-ref.sh |    4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/git-commit.sh b/git-commit.sh
index 6c95817..655340c 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -292,13 +292,12 @@ case "$#,$also,$only,$amend" in
 0,,t,)
 	die "No paths with --only does not make sense." ;;
 0,,t,t)
-	only_include_assumed="# Clever... amending the last one with dirty index." ;;
+	only_include_assumed="Clever... amending the last one with dirty index." ;;
 0,,,*)
-	: all=t
-	only_include_assumed="# We will start assuming -a without -i; you have been warned."
+	all=t
+	only_include_assumed="No -o nor -i is given; committing --all"
 	;;
 *,,,*)
-	only_include_assumed="# Explicit paths specified without -i nor -o; assuming --only paths..."
 	also=
 	;;
 esac
@@ -542,9 +541,9 @@ then
 		echo "# Please enter the commit message for your changes."
 		echo "# (Comment lines starting with '#' will not be included)"
 		test -z "$only_include_assumed" || {
-			echo "#"
-			echo "$only_include_assumed"
-			echo "#"
+			echo "################################################"
+			echo "# $only_include_assumed"
+			echo "################################################"
 		}
 		run_status
 	} >>"$GIT_DIR"/COMMIT_EDITMSG
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 6a917f2..1580224 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -200,13 +200,13 @@ test_expect_success \
 	 h_OTHER=$(git-rev-parse --verify HEAD) &&
 	 echo FIXED >F &&
 	 GIT_AUTHOR_DATE="2005-05-26 23:44" \
-	 GIT_COMMITTER_DATE="2005-05-26 23:44" git-commit --amend &&
+	 GIT_COMMITTER_DATE="2005-05-26 23:44" git-commit --amend -i &&
 	 h_FIXED=$(git-rev-parse --verify HEAD) &&
 	 echo TEST+FIXED >F &&
 	 echo Merged initial commit and a later commit. >M &&
 	 echo $h_TEST >.git/MERGE_HEAD &&
 	 GIT_AUTHOR_DATE="2005-05-26 23:45" \
-	 GIT_COMMITTER_DATE="2005-05-26 23:45" git-commit -F M &&
+	 GIT_COMMITTER_DATE="2005-05-26 23:45" git-commit -F M -i &&
 	 h_MERGED=$(git-rev-parse --verify HEAD)
 	 rm -f M'
 
-- 
1.4.4.1.gcee8-dirty
Previous: Junio C HamanoNext: Jakub Narebski
Message 22 of 25 in “"init-db" can really be just "init"”
  1. "init-db" can really be just "init"Nicolas Pitre, Nov 27, 2006
  2. Junio C HamanoNov 27, 2006
  3. Hyphens and hiding core commands (was: "init-db" can really be just "init")Carl Worth, Nov 27, 2006
  4. Junio C HamanoNov 27, 2006
  5. Carl WorthNov 28, 2006
  6. Junio C HamanoNov 28, 2006
  7. Carl WorthNov 28, 2006
  8. Junio C HamanoNov 28, 2006
  9. 0/2 Making "git commit" to mean "git commit -a".Junio C Hamano, Nov 28, 2006
  10. Andy WhitcroftNov 28, 2006
  11. Josef WeidendorferNov 28, 2006
  12. Jakub NarebskiNov 28, 2006
  13. Carl WorthNov 28, 2006
  14. Salikh ZakirovNov 30, 2006
  15. Jakub NarebskiNov 30, 2006
  16. Seth FalconNov 30, 2006
  17. Nguyen Thai Ngoc DuyNov 30, 2006
  18. Seth FalconNov 30, 2006
  19. Jakub NarebskiNov 30, 2006
  20. Andy WhitcroftNov 30, 2006
  21. 1/2 git-commit: prepare to make '-a' behaviour the default.Junio C Hamano, Nov 28, 2006
  22. 2/2 git-commit: make '-a' the default.Junio C Hamano, Nov 28, 2006
  23. Jakub NarebskiNov 28, 2006
  24. Johannes SchindelinNov 27, 2006
  25. Han-Wen NienhuysNov 28, 2006

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.