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

[PATCH] git-commit: pass explicit path to git-diff-files.

From
Junio C Hamano <junkio@cox.net>
Date
Aug 17, 2005, 05:34 UTC
Message-ID
<7vu0hp2kjv.fsf@assigned-by-dhcp.cox.net>

When running "git commit" with explicit path arguments, allow it to take directory name. This makes "git commit Documentation/" to commit everything that is changed under Documentation/ directory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-commit-script |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
cf2997f54cd650443368374dc0c5bcceab5b481c
diff --git a/git-commit-script b/git-commit-script
--- a/git-commit-script
+++ b/git-commit-script
@@ -88,9 +88,14 @@ esac
 case "$all" in
 t)
 	git-diff-files --name-only -z |
-	xargs -0 git-update-cache -q -- || exit 1 ;;
-esac
-git-update-cache -q --refresh -- "$@" || exit 1
+	xargs -0 git-update-cache -q --
+	;;
+*)
+	git-diff-files --name-only -z "$@" |
+	xargs -0 git-update-cache -q --
+	;;
+esac || exit 1
+git-update-cache -q --refresh || exit 1
 
 case "$verify" in
 t)
Message 1 of 1 in “git-commit: pass explicit path to git-diff-files.”
  1. git-commit: pass explicit path to git-diff-files.Junio C Hamano, Aug 17, 2005

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.