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

Re: Regression: git-commit no longer works from within subdirectories

From
Jeff King <peff@peff.net>
Date
Aug 3, 2006, 20:29 UTC
Message-ID
<20060803202957.GA26838@coredump.intra.peff.net>
In-Reply-To
<44D23B1C.80704@codeweavers.com>
On Thu, Aug 03, 2006 at 07:06:20PM +0100, Robert Shearman wrote:
> It fails with a confusing message when you are in a subdirectory:
> rob@saturn:~/wine-git/dlls/msi$ git commit action.c
> usage: git-read-tree (<sha> | [[-m [--aggressive] | --reset | 
> --prefix=<prefix>] [-u | -i]] <sha1> [<sha2> [<sha3>]])

The culprit is the recent changes to the builtins. cmd_read_tree now takes an extra parameter 'prefix' which shadows the global declaration in builtin-read-tree.c (and has a completely different meaning).

The one-liner below fixes it (though style-wise, you may prefer to rename the shadowed variable).

-Peff
---
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 49c10bf..8e3b04e 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -870,7 +870,7 @@ static const char read_tree_usage[] = "g
 
 static struct lock_file lock_file;
 
-int cmd_read_tree(int argc, const char **argv, const char *prefix)
+int cmd_read_tree(int argc, const char **argv, const char *git_prefix)
 {
        int i, newfd, stage = 0;
        unsigned char sha1[20];
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “Regression: git-commit no longer works from within subdirectories”
  1. Robert ShearmanAug 3, 2006
  2. Junio C HamanoAug 3, 2006
  3. Jeff KingAug 3, 2006
  4. Junio C HamanoAug 4, 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.