{"thread":{"id":"1594","subject":"git commit (or git-commit-script) question","startedAt":"2005-08-19T17:06:36Z","lastAt":"2005-08-19T19:52:01Z","messageCount":4,"participants":["Johnny Stenback","Linus Torvalds","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7567","messageId":"4306119C.8000600@jstenback.com","threadId":"1594","inReplyTo":null,"subject":"git commit (or git-commit-script) question","fromName":"Johnny Stenback","fromEmail":"jst@jstenback.com","sentAt":"2005-08-19T17:06:36Z","receivedAt":"2005-08-19T17:06:36Z","isPatch":false,"sender":{"key":"jst@jstenback.com","avatar":null},"body":"Hey all,\n\ngit-commit-script --help says:\n\ngit commit [-a]  [-m <message>] [-F <logfile>] [(-C|-c) <commit>] \n[<path>...]\n\nThat made me assume that if I do:\n\n   git-commit-script somedir\n\nit would *only* commit the changes I've made in \"somedir\", but it \nappears to commit *all* files that have changed (and shows all files in \nthe list of changed files in the commit message it displays in the \neditor), as if it's completely ignoring the <path> argument.\n\nKnown problem? I got this using git that I pulled from kernel.org \nearlier this morning.\n\n-- \njst\n"},{"id":"7568","messageId":"Pine.LNX.4.58.0508191028190.3412@g5.osdl.org","threadId":"1594","inReplyTo":"4306119C.8000600@jstenback.com","subject":"Re: git commit (or git-commit-script) question","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-19T17:36:35Z","receivedAt":"2005-08-19T17:36:35Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 19 Aug 2005, Johnny Stenback wrote:\n> \n> That made me assume that if I do:\n> \n>    git-commit-script somedir\n> \n> it would *only* commit the changes I've made in \"somedir\", but it \n> appears to commit *all* files that have changed (and shows all files in \n> the list of changed files in the commit message it displays in the \n> editor), as if it's completely ignoring the <path> argument.\n> \n> Known problem? I got this using git that I pulled from kernel.org \n> earlier this morning.\n\nIt works for me. You _should_ see something like\n\n\t#\n\t# Updated but not checked in:\n\t#   (will commit)\n\t#\n\t#       modified: somedir/somefile\n\t#\n\t#\n\t# Changed but not updated:\n\t#   (use git-update-cache to mark for commit)\n\t#\n\t#\tmodified: otherdir/anotherfile\n\t#\n\nwhich basically means that it will commit \"somedir/somefile\", but _not_ \ncommit \"otherdir/anotherfile\".\n\nHowever, one thing to look out for is that if you've marked any files for \nupdate (with git-update-cache) those will always be committed regardless \nof what arguments you give to \"git commit\". You can reset the index with \n\"git reset\" if you decided that you don't want to commit after all.\n\n(For example, if you do a \"git commit --all\", but decide not to commit \nafter all by writing an empty commit message, that will already have \nmarked all the files to be committed, so next time, even if you then use \n\"git commit somedir\", all the files in all the _other_ dirs have already \nbeen marked for update, so you'll see everything being committed).\n\n\t\t\tLinus\n"},{"id":"7569","messageId":"43061A94.9030002@jstenback.com","threadId":"1594","inReplyTo":"Pine.LNX.4.58.0508191028190.3412@g5.osdl.org","subject":"Re: git commit (or git-commit-script) question","fromName":"Johnny Stenback","fromEmail":"jst@jstenback.com","sentAt":"2005-08-19T17:44:52Z","receivedAt":"2005-08-19T17:44:52Z","isPatch":false,"sender":{"key":"jst@jstenback.com","avatar":null},"body":"Ah, that explains it. I had already marked all my changes for update, \nthat's what threw me off here. Thanks!\n\nLinus Torvalds wrote:\n> \n> On Fri, 19 Aug 2005, Johnny Stenback wrote:\n>> That made me assume that if I do:\n>>\n>>    git-commit-script somedir\n>>\n>> it would *only* commit the changes I've made in \"somedir\", but it \n>> appears to commit *all* files that have changed (and shows all files in \n>> the list of changed files in the commit message it displays in the \n>> editor), as if it's completely ignoring the <path> argument.\n>>\n>> Known problem? I got this using git that I pulled from kernel.org \n>> earlier this morning.\n> \n> It works for me. You _should_ see something like\n> \n> \t#\n> \t# Updated but not checked in:\n> \t#   (will commit)\n> \t#\n> \t#       modified: somedir/somefile\n> \t#\n> \t#\n> \t# Changed but not updated:\n> \t#   (use git-update-cache to mark for commit)\n> \t#\n> \t#\tmodified: otherdir/anotherfile\n> \t#\n> \n> which basically means that it will commit \"somedir/somefile\", but _not_ \n> commit \"otherdir/anotherfile\".\n> \n> However, one thing to look out for is that if you've marked any files for \n> update (with git-update-cache) those will always be committed regardless \n> of what arguments you give to \"git commit\". You can reset the index with \n> \"git reset\" if you decided that you don't want to commit after all.\n> \n> (For example, if you do a \"git commit --all\", but decide not to commit \n> after all by writing an empty commit message, that will already have \n> marked all the files to be committed, so next time, even if you then use \n> \"git commit somedir\", all the files in all the _other_ dirs have already \n> been marked for update, so you'll see everything being committed).\n> \n> \t\t\tLinus\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n\n-- \njst\n"},{"id":"7573","messageId":"7vd5o9yaam.fsf@assigned-by-dhcp.cox.net","threadId":"1594","inReplyTo":"Pine.LNX.4.58.0508191028190.3412@g5.osdl.org","subject":"Re: git commit (or git-commit-script) question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-19T19:52:01Z","receivedAt":"2005-08-19T19:52:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> However, one thing to look out for is that if you've marked any files for \n> update (with git-update-cache) those will always be committed regardless \n> of what arguments you give to \"git commit\".\n\nAnother thing to look out for is that the files you told it\nabout with \"git add\" will be included and does not show up in\n\"git diff\", because there currently is no way to record \"intent\nto add\" (rather, \"Mr GIT, please keep an eye on this file\")\nwithout actually adding a path to the index file for inclusion\nin the next commit.\n\nI have a couple of updates to git-commit-script in the proposed\nupdates branch, and one of the changes is that git-update-cache\nin git-commit-script, used when either the --all flag or\nexplicit paths are given, has a --remove flag there.  The reason\nit does not need --add flag there as well is a direct\nconsequence of this asymmetry.\n\nAlthough I do not think this asymmetry a major source of\nconfusion, I suspect that we could \"fix\" it by treating an index\nentry with all-zero mode and sha1 as \"keep-an-eye-on\" entry with\na new flag \"git-update-cache --watch <path>\" or something like\nthat.  \"git-diff-files\" would then treat that special entry as a\nnonexistent path and would compare it with whatever happens to\nbe (or lack of it) in the working tree, and \"git diff\" would\nshow a diff that creates the file.  This needs a tweak or two in\nthe diffcore machinery as well.\n"}]}