{"thread":{"id":"2701","subject":"'git commit' ignoring args?","startedAt":"2005-11-28T16:24:32Z","lastAt":"2005-11-29T11:03:11Z","messageCount":6,"participants":["Jeff Garzik","Junio C Hamano","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"12881","messageId":"438B2F40.6070801@pobox.com","threadId":"2701","inReplyTo":null,"subject":"'git commit' ignoring args?","fromName":"Jeff Garzik","fromEmail":"jgarzik@pobox.com","sentAt":"2005-11-28T16:24:32Z","receivedAt":"2005-11-28T16:24:32Z","isPatch":false,"sender":{"key":"jgarzik@pobox.com","avatar":null},"body":"\nWith the latest git as of this writing, executing\n\n\tgit commit Makefile stylesheet.xsl\n\nresults in an attempt to commit the above files, and also another file \nbook.xml.  book.xml is modified, but I do not wish to check it in at \nthis time, so I did not list it as an argument to 'git commit'.\n\nThe only commit in the repository is the initial commit.\n\n#\n# Updated but not checked in:\n#   (will commit)\n#\n#       modified: Makefile\n#       modified: book.xml\n#       new file: stylesheet.xsl\n#\n#\n# Untracked files:\n#   (use \"git add\" to add to commit)\n#\n#       book.pdf\n\nExpected behavior is that Makefile and stylesheet.xsl would be checked \nin, but not book.xml.\n\n\tJeff\n"},{"id":"12887","messageId":"7vzmnotwyr.fsf@assigned-by-dhcp.cox.net","threadId":"2701","inReplyTo":"438B2F40.6070801@pobox.com","subject":"Re: 'git commit' ignoring args?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-28T19:05:00Z","receivedAt":"2005-11-28T19:05:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff Garzik <jgarzik@pobox.com> writes:\n\n> With the latest git as of this writing, executing\n>\n> \tgit commit Makefile stylesheet.xsl\n>\n> results in an attempt to commit the above files, and also another file \n> book.xml.  book.xml is modified, but I do not wish to check it in at \n> this time, so I did not list it as an argument to 'git commit'.\n>\n> The only commit in the repository is the initial commit.\n>\n> #\n> # Updated but not checked in:\n> #   (will commit)\n> #\n> #       modified: Makefile\n> #       modified: book.xml\n> #       new file: stylesheet.xsl\n> #\n> #\n> # Untracked files:\n> #   (use \"git add\" to add to commit)\n> #\n> #       book.pdf\n>\n> Expected behavior is that Makefile and stylesheet.xsl would be checked \n> in, but not book.xml.\n\nIt should work that way, you are right.  And it worried me so\nmuch that I tried to reproduce, but I couldn't.\n\nThe status output says it will _commit_ book.xml by listing it\nin \"Updated but not checked in\" section, without listing it also\nin \"Changed but not updated\".  Which means that when the\ngit-status was run (that is immediately after 'git-commit'\nprocessed your command line and did git-update-index on Makefile\nstylesheet.xsl for you), the index file had book.xml in sync\nwith your modified version in your working tree.\n\nCould it be that at some point after touching book.xml before\nrunning git commit you did update-index on it?\n\n\n-- >8 --\nHere is what I did to reproduce.\n\nStart afresh.\n\n        $ cd /var/tmp/\n        $ rm -fr jg\n        $ mkdir jg\n        $ cd jg\n        $ git-init-db\n        defaulting to local storage area\n\nPrepare two files and make initial commit.\n\n        $ date >Makefile\n        $ date >book.xml\n        $ git add Makefile book.xml\n        $ git commit -m 'Initial'\n        Committing initial tree 4a7017a5ec4870d44c340943c66a7f0c1cf4885d\n\nThere are two files.\n\n        $ git ls-tree HEAD\n        100644 blob c803676f9cab3249b5b1d225e53b6d14c8545a5e\tMakefile\n        100644 blob 6f3b56bbff37d24d9faa78c3e0566cdab4dce8e9\tbook.xml\n\nModify two, add one.\n\n        $ date >>book.xml\n        $ date >>Makefile\n        $ date >stylesheet.xsl\n        $ git add stylesheet.xsl\n\nSee what happened.  The index file knows only about addition; we\nhave not told git about changes we did to book.xml and Makefile\nyet.\n\n        $ git diff --name-status --cached HEAD\n        A\tstylesheet.xsl\n\nThe working tree has three changes since the last commit.\n\n        $ git diff --name-status HEAD\n        M\tMakefile\n        M\tbook.xml\n        A\tstylesheet.xsl\n\nThe working tree is different from the index file in two paths.\n\n        $ git diff --name-status\n        M\tMakefile\n        M\tbook.xml\n\nDo a partial commit, naming two files.\n\n        $ git commit -m 'commit two' Makefile stylesheet.xsl\n\nWhat's different between the working tree and what we just\ncommitted?\n\n        $ git diff --name-status HEAD\n        M\tbook.xml\n\nWe should not have committed changes to book.xml; we haven't.\n\n        $ git diff-tree --name-status HEAD\n        1d3ed9f438aa705fd8433bc23400814468a1a353\n        M\tMakefile\n        A\tstylesheet.xsl\n        $ exit\n"},{"id":"12899","messageId":"438B8C6C.8030407@op5.se","threadId":"2701","inReplyTo":"438B2F40.6070801@pobox.com","subject":"Re: 'git commit' ignoring args?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-28T23:02:04Z","receivedAt":"2005-11-28T23:02:04Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Jeff Garzik wrote:\n> \n> With the latest git as of this writing, executing\n> \n>     git commit Makefile stylesheet.xsl\n> \n> results in an attempt to commit the above files, and also another file \n> book.xml.  book.xml is modified, but I do not wish to check it in at \n> this time, so I did not list it as an argument to 'git commit'.\n> \n\nThe index has been updated to match the file on disk somehow (perhaps \nyou did 'git add book.xml'?). You can un-mark it with\n\n\tgit reset HEAD\n\nwhich is equivalent to\n\n\tgit read-tree --reset HEAD\n\nso long as you're operating on HEAD.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"12900","messageId":"loom.20051129T003332-60@post.gmane.org","threadId":"2701","inReplyTo":"438B8C6C.8030407@op5.se","subject":"Re: 'git commit' ignoring args?","fromName":"Junio C Hamano","fromEmail":"junkio@twinsun.com","sentAt":"2005-11-28T23:44:34Z","receivedAt":"2005-11-28T23:44:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Ericsson <ae <at> op5.se> writes:\n\n> The index has been updated to match the file on disk somehow (perhaps \n> you did 'git add book.xml'?).\n\nbook.xml is known to the index file at this point.  \"git add book.xml\" will\n*not* run update-index on that path, so that is not it.\n"},{"id":"12928","messageId":"438C2FB5.5050605@op5.se","threadId":"2701","inReplyTo":"loom.20051129T003332-60@post.gmane.org","subject":"Re: 'git commit' ignoring args?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-29T10:38:45Z","receivedAt":"2005-11-29T10:38:45Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Andreas Ericsson <ae <at> op5.se> writes:\n> \n> \n>>The index has been updated to match the file on disk somehow (perhaps \n>>you did 'git add book.xml'?).\n> \n> \n> book.xml is known to the index file at this point.  \"git add book.xml\" will\n> *not* run update-index on that path, so that is not it.\n> \n\nAt this point, yes, but if it was just added it wouldn't have been \nbefore it was git-add'ed.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"12929","messageId":"438C356F.9080301@pobox.com","threadId":"2701","inReplyTo":"7vzmnotwyr.fsf@assigned-by-dhcp.cox.net","subject":"Re: 'git commit' ignoring args?","fromName":"Jeff Garzik","fromEmail":"jgarzik@pobox.com","sentAt":"2005-11-29T11:03:11Z","receivedAt":"2005-11-29T11:03:11Z","isPatch":false,"sender":{"key":"jgarzik@pobox.com","avatar":null},"body":"Junio C Hamano wrote:\n> Could it be that at some point after touching book.xml before\n> running git commit you did update-index on it?\n\nNot according to scrollback, no.\n\n\n> -- >8 --\n> Here is what I did to reproduce.\n\nUnfortunately, I cannot reproduce the problem either :(\n\nOh well, as long as the facility works in general, I'll live to fight \nanother day :)\n\n\tJeff\n"}]}