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

git-commit broken with GIT_INDEX_FILE

From
TJTim Janik <timj@gtk.org>
Date
Oct 31, 2007, 15:02 UTC
Message-ID
<Pine.LNX.4.62.0710311549380.21251@master.birnet.private>
hey All.
i'm maintaining my own git porcelainen, and as part of that had to
(re-)implement my own commit command:
   http://blogs.gnome.org/timj/2007/10/13/13102007-yummy-yummy-porcelain-version-08/
i've read through git-commit and cg-commit, and would really like to avoid
reimplementing the hook and utf8 encoding handling. thus, my tool calls
git-commit once it has created an index file with all the files that
need comitting.
ideally, it'd construct a temporary index, e.g. $GIT_DIR/next-index$$ and
then invoke:
   GIT_INDEX_FILE=$GIT_DIR/next-index$$ git-commit -F commitmsg.txt
this is not working as expected however.

when GIT_INDEX_FILE=tmpindex is specified for git-commit-1.5.3.4, it will construct a commit message for tmpindex, but it'll still use the standard index file $GIT_DIR/index for git-write-tree.

(so my current implementation saves and restores the standard index file around committs.)

for consistent commit messages, the index file used for commit message construction should be the same index used for git-write-tree. ideally however, GIT_INDEX_FILE=tmpindex git-commit would work correctly in using tmpindex for git-write-tree as well.

--- ciaoTJ

Message 1 of 1 in “git-commit broken with GIT_INDEX_FILE”
  1. Tim JanikOct 31, 2007

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.