{"thread":{"id":"26591","subject":"Why doesn't git commit -a track new files","startedAt":"2011-02-24T10:22:46Z","lastAt":"2011-02-26T06:45:05Z","messageCount":25,"participants":["Marco","Ævar Arnfjörð Bjarmason","Pascal Obry","Michael J Gruber","Jeff King","Matthieu Moy","Marc Weber","Junio C Hamano","Miles Bader"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162127","messageId":"20110224112246.3f811ac2@glyph","threadId":"26591","inReplyTo":null,"subject":"Why doesn't git commit -a track new files","fromName":"Marco","fromEmail":"netuse@lavabit.com","sentAt":"2011-02-24T10:22:46Z","receivedAt":"2011-02-24T10:22:46Z","isPatch":false,"sender":{"key":"netuse@lavabit.com","avatar":null},"body":"Hi,\n\nI'm new to git and a bit confused about how some commands work.\n\ngit add .                    -- Adds everything *but* deleted files\ngit add -A                   -- Adds everything\ngit commit -a -m \"whatever\"  -- Commits everything *but* new files\n\nI don't understand why there's not switch (is there?) for commit to commit new\nand deleted files, like -A for git add? Is the only thing to do this sth like\n\ngit add -A && git commit -m \"Message\"\n\n\nMarco\n"},{"id":"162137","messageId":"AANLkTin50SHDPs56JgZc-2e8CELAimsscUS_BXunQXkm@mail.gmail.com","threadId":"26591","inReplyTo":"20110224112246.3f811ac2@glyph","subject":"Re: Why doesn't git commit -a track new files","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-24T14:06:07Z","receivedAt":"2011-02-24T14:06:07Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Feb 24, 2011 at 11:22, Marco <netuse@lavabit.com> wrote:\n> I'm new to git and a bit confused about how some commands work.\n>\n> git add .                    -- Adds everything *but* deleted files\n> git add -A                   -- Adds everything\n> git commit -a -m \"whatever\"  -- Commits everything *but* new files\n>\n> I don't understand why there's not switch (is there?) for commit to commit new\n> and deleted files, like -A for git add? Is the only thing to do this sth like\n>\n> git add -A && git commit -m \"Message\"\n\nYou mean commit things you deleted, and untracked files?\n\nThat's a good question actually. It would be useful in some cases.\n\nI've scripted around that a few times, maybe a switch for that would be useful.\n"},{"id":"162138","messageId":"AANLkTinDT6jBxQZ5eukA6Fa=-xRMJsHTJ4pM+Hz4KER_@mail.gmail.com","threadId":"26591","inReplyTo":"20110224112246.3f811ac2@glyph","subject":"Re: Why doesn't git commit -a track new files","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-02-24T14:09:55Z","receivedAt":"2011-02-24T14:09:55Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Marco,\n\n> I don't understand why there's not switch (is there?) for commit to commit new\n> and deleted files, like -A for git add? Is the only thing to do this sth like\n>\n> git add -A && git commit -m \"Message\"\n\nNever had the need for this. The reason is maybe when you are trying to have\na small set if incremental commits, you usually don't want to add everything but\nyou review the change carefully with \"git add -p\". Now in some circumstances\nit could probably be useful.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"},{"id":"162140","messageId":"20110224152027.05aed833@glyph","threadId":"26591","inReplyTo":"AANLkTinDT6jBxQZ5eukA6Fa=-xRMJsHTJ4pM+Hz4KER_@mail.gmail.com","subject":"Re: Why doesn't git commit -a track new files","fromName":"Marco","fromEmail":"netuse@lavabit.com","sentAt":"2011-02-24T14:20:27Z","receivedAt":"2011-02-24T14:20:27Z","isPatch":false,"sender":{"key":"netuse@lavabit.com","avatar":null},"body":"On 2011-02-24 Pascal Obry <pascal@obry.net> wrote:\n\n> Marco,\n> \n> > I don't understand why there's not switch (is there?) for commit to\n> > commit new and deleted files, like -A for git add? Is the only thing to\n> > do this sth like\n> >\n> > git add -A && git commit -m \"Message\"\n> \n> Never had the need for this. The reason is maybe when you are trying to have\n> a small set if incremental commits, you usually don't want to add\n> everything but you review the change carefully with \"git add -p\".\n\nOf course not as default behaviour. Just as a switch (e.g. -A). If one wishes\nthis behaviour one can use it. Nobody forces you to use it (like -a).\n\n> Now in some circumstances it could probably be useful.\n\nYes.\n\n\nMarco\n"},{"id":"162151","messageId":"4D6672F7.4020101@drmicha.warpmail.net","threadId":"26591","inReplyTo":"20110224112246.3f811ac2@glyph","subject":"Re: Why doesn't git commit -a track new files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-02-24T15:02:15Z","receivedAt":"2011-02-24T15:02:15Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Marco venit, vidit, dixit 24.02.2011 11:22:\n> Hi,\n> \n> I'm new to git and a bit confused about how some commands work.\n> \n> git add .                    -- Adds everything *but* deleted files\n> git add -A                   -- Adds everything\n> git commit -a -m \"whatever\"  -- Commits everything *but* new files\n> \n> I don't understand why there's not switch (is there?) for commit to commit new\n> and deleted files, like -A for git add? Is the only thing to do this sth like\n> \n> git add -A && git commit -m \"Message\"\n\n\"commit -a\" is much like \"add -u\", at least when used without file\narguments (\"pathspec\").\n\n\"commit -A\" does not exist, so that \"git add -A && git commit\" is your\nonly way.\n\nWhy does it not exist? Because you should at least\n\"git add -A && git status && behappy && git commit\".\n\nThe middle part of that line could be done in the editor which commit\ninvokes, of course.\n\n>From the technical side: git-add and git-commit share surprsingly little\ncode (the \"add\" part of commit is not shared). So, implementing it\nwouldn't simply be a different \"add call\" from commit.\n\nAlso, \"-A\" supports a very \"un-gitty\" way of using git. This makes it\nunlikely that someone cares to implement it... (By \"un-gitty\" I don't\nmean a matter of personal taste, but a matter of fruitful habits.)\n\nMichael\n"},{"id":"162155","messageId":"20110224154908.GA29309@sigill.intra.peff.net","threadId":"26591","inReplyTo":"4D6672F7.4020101@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-02-24T15:49:08Z","receivedAt":"2011-02-24T15:49:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 24, 2011 at 04:02:15PM +0100, Michael J Gruber wrote:\n\n> \"commit -A\" does not exist, so that \"git add -A && git commit\" is your\n> only way.\n>\n> [...]\n>\n> Also, \"-A\" supports a very \"un-gitty\" way of using git. This makes it\n> unlikely that someone cares to implement it... (By \"un-gitty\" I don't\n> mean a matter of personal taste, but a matter of fruitful habits.)\n\nActually, I would find \"git commit -A\" useful. Not as part of my normal\nproject workflow, but would be a great shorthand for one-off debuggings\n(e.g., \"echo content >>file && git commit -A -m msg\", which Just Works\nwhether it is the first or a later commit).\n\nBut as you mentioned, it is sadly not as trivial as just adding a new\nway to call \"git add\". So I think nobody has simply cared enough to\nimplement it to date.\n\n-Peff\n"},{"id":"162156","messageId":"4D667F1A.5060408@drmicha.warpmail.net","threadId":"26591","inReplyTo":"20110224154908.GA29309@sigill.intra.peff.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-02-24T15:54:02Z","receivedAt":"2011-02-24T15:54:02Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jeff King venit, vidit, dixit 24.02.2011 16:49:\n> On Thu, Feb 24, 2011 at 04:02:15PM +0100, Michael J Gruber wrote:\n> \n>> \"commit -A\" does not exist, so that \"git add -A && git commit\" is your\n>> only way.\n>>\n>> [...]\n>>\n>> Also, \"-A\" supports a very \"un-gitty\" way of using git. This makes it\n>> unlikely that someone cares to implement it... (By \"un-gitty\" I don't\n>> mean a matter of personal taste, but a matter of fruitful habits.)\n> \n> Actually, I would find \"git commit -A\" useful. Not as part of my normal\n> project workflow, but would be a great shorthand for one-off debuggings\n> (e.g., \"echo content >>file && git commit -A -m msg\", which Just Works\n> whether it is the first or a later commit).\n> \n> But as you mentioned, it is sadly not as trivial as just adding a new\n> way to call \"git add\". So I think nobody has simply cared enough to\n> implement it to date.\n\nHow about this program:\n\n- refactor add, commit to share the \"add parts\"\n- homogenize interface: replace \"add -u\" by \"add -a\" (hidden\ncompatibility thingy of course)\n- hom. interface: allow \"-a pathspec\" for commit\n- have commit -A\n\nOh, and do \"commit -n\" what one would expect [1.8.0] :)\n\nMichael\n"},{"id":"162158","messageId":"20110224160027.GA30275@sigill.intra.peff.net","threadId":"26591","inReplyTo":"4D667F1A.5060408@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-02-24T16:00:27Z","receivedAt":"2011-02-24T16:00:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 24, 2011 at 04:54:02PM +0100, Michael J Gruber wrote:\n\n> > But as you mentioned, it is sadly not as trivial as just adding a new\n> > way to call \"git add\". So I think nobody has simply cared enough to\n> > implement it to date.\n> \n> How about this program:\n> \n> - refactor add, commit to share the \"add parts\"\n\nSounds good.\n\n> - homogenize interface: replace \"add -u\" by \"add -a\" (hidden\n> compatibility thingy of course)\n\nI like it.\n\n> - hom. interface: allow \"-a pathspec\" for commit\n\nWhat would it do? It would just behave like \"git commit -i pathspec\"?\n\n> - have commit -A\n\nSounds good.\n\n> Oh, and do \"commit -n\" what one would expect [1.8.0] :)\n\nYeah, I like that, too.\n\nAre you volunteering to work on it all? :)\n\n-Peff\n"},{"id":"162160","messageId":"4D6680F3.1000205@drmicha.warpmail.net","threadId":"26591","inReplyTo":"20110224160027.GA30275@sigill.intra.peff.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-02-24T16:01:55Z","receivedAt":"2011-02-24T16:01:55Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jeff King venit, vidit, dixit 24.02.2011 17:00:\n> On Thu, Feb 24, 2011 at 04:54:02PM +0100, Michael J Gruber wrote:\n> \n>>> But as you mentioned, it is sadly not as trivial as just adding a\n>>> new way to call \"git add\". So I think nobody has simply cared\n>>> enough to implement it to date.\n>> \n>> How about this program:\n>> \n>> - refactor add, commit to share the \"add parts\"\n> \n> Sounds good.\n> \n>> - homogenize interface: replace \"add -u\" by \"add -a\" (hidden \n>> compatibility thingy of course)\n> \n> I like it.\n> \n>> - hom. interface: allow \"-a pathspec\" for commit\n> \n> What would it do? It would just behave like \"git commit -i\n> pathspec\"?\n\nIt should do what \"-u pathspec\" does for add: limit \"all tracked\" to the\npathspec. I know it's the same as without \"-a\", but why bail out on it?\n\n> \n>> - have commit -A\n> \n> Sounds good.\n> \n>> Oh, and do \"commit -n\" what one would expect [1.8.0] :)\n> \n> Yeah, I like that, too.\n> \n> Are you volunteering to work on it all? :)\n\nI've done all the careful planning already, laid out in nice steps. Now\nit's your time ;)\n\nOK, I'll do \"-n\".\n\nMichael\n"},{"id":"162159","messageId":"vpqk4gp4dxf.fsf@bauges.imag.fr","threadId":"26591","inReplyTo":"4D6672F7.4020101@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-02-24T16:04:12Z","receivedAt":"2011-02-24T16:04:12Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Why does it not exist? Because you should at least\n> \"git add -A && git status && behappy && git commit\".\n\nThere are alternatives like\n\ngit status && behappy && git commit -A\n\nor\n\ngit commit -A && look at status $EDITOR && behapy && save\n\n> Also, \"-A\" supports a very \"un-gitty\" way of using git. This makes it\n> unlikely that someone cares to implement it...\n\nI guess that's it. It's not usefull to most Git developers, hence nobody\ncared to implement it. But IIRC the switch \"add -A\" was chosen partly\nbecause -A didn't exist for commit, hence this leaves room for commit\n-A.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"162162","messageId":"4D668181.404@drmicha.warpmail.net","threadId":"26591","inReplyTo":"vpqk4gp4dxf.fsf@bauges.imag.fr","subject":"Re: Why doesn't git commit -a track new files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-02-24T16:04:17Z","receivedAt":"2011-02-24T16:04:17Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Matthieu Moy venit, vidit, dixit 24.02.2011 17:04:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n>> Why does it not exist? Because you should at least\n>> \"git add -A && git status && behappy && git commit\".\n> \n> There are alternatives like\n> \n> git status && behappy && git commit -A\n\nThat may not give the full picture of untracked stuff in subdirs.\n\n> or\n> \n> git commit -A && look at status $EDITOR && behapy && save\n\nYes, I even mentioned that, but you cut it. Bad bad boy! ;)\n\n>> Also, \"-A\" supports a very \"un-gitty\" way of using git. This makes it\n>> unlikely that someone cares to implement it...\n> \n> I guess that's it. It's not usefull to most Git developers, hence nobody\n> cared to implement it. But IIRC the switch \"add -A\" was chosen partly\n> because -A didn't exist for commit, hence this leaves room for commit\n\nYes.\n\nSo, we have one more volunteer for the plan just laid out, right?\n\nMichael\n"},{"id":"162163","messageId":"20110224160932.GC30275@sigill.intra.peff.net","threadId":"26591","inReplyTo":"4D6680F3.1000205@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-02-24T16:09:33Z","receivedAt":"2011-02-24T16:09:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 24, 2011 at 05:01:55PM +0100, Michael J Gruber wrote:\n\n> >> - hom. interface: allow \"-a pathspec\" for commit\n> > \n> > What would it do? It would just behave like \"git commit -i\n> > pathspec\"?\n> \n> It should do what \"-u pathspec\" does for add: limit \"all tracked\" to the\n> pathspec. I know it's the same as without \"-a\", but why bail out on it?\n\nWithout \"-a\", we do \"git commit -o\", which is slightly different with\nrespect to stuff in the index.  In the case of:\n\n  git add -u <path> && git commit\n\nwe will add new changes from <path>, and then commit them along with\nwhatever was already in the index.\n\nWith:\n\n  git commit <path>\n\nWe will commit _just_ the changes in <path>, regardless of what is in\nthe index.\n\nI assumed that:\n\n git commit -a <path>\n\nwould behave more like the \"git add -u <path>\" case; add new stuff to\nthe index from <path>, and then commit those changes plus whatever was\nalready in the index.\n\n> I've done all the careful planning already, laid out in nice steps. Now\n> it's your time ;)\n\nHeh. Transitioning to management, I see.\n\n-Peff\n"},{"id":"162165","messageId":"1298564280-sup-4262@localhost.localdomain","threadId":"26591","inReplyTo":"20110224112246.3f811ac2@glyph","subject":"Re: Why doesn't git commit -a track new files","fromName":"Marc Weber","fromEmail":"marco-oweber@gmx.de","sentAt":"2011-02-24T16:19:10Z","receivedAt":"2011-02-24T16:19:10Z","isPatch":false,"sender":{"key":"marco-oweber@gmx.de","avatar":null},"body":"I'd not change behaviour of\ngit commit -a\n\nintroducing \n\ngit commit -A behaving like git add -A && git commit would be fine.\n\nMarc Weber\n"},{"id":"162168","messageId":"20110224174740.5b1aec4f@glyph","threadId":"26591","inReplyTo":"4D668181.404@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Marco","fromEmail":"netuse@lavabit.com","sentAt":"2011-02-24T16:47:40Z","receivedAt":"2011-02-24T16:47:40Z","isPatch":false,"sender":{"key":"netuse@lavabit.com","avatar":null},"body":"On 2011-02-24 Michael J Gruber <git@drmicha.warpmail.net> wrote:\n\n> > git status && behappy && git commit -A\n> \n> That may not give the full picture of untracked stuff in subdirs.\n\nMay I ask why not? AFAIK git status outputs staged and untracked stuff.\n\n> > git commit -A && look at status $EDITOR && behapy && save\n> \n> Yes, I even mentioned that, but you cut it. Bad bad boy! ;)\n> \n> >> Also, \"-A\" supports a very \"un-gitty\" way of using git. This makes it\n> >> unlikely that someone cares to implement it...\n\nI think it *can* be used in an appropriate manner.\nBTW: Why isn't commit -a »un-gitty«?\n\n\nMarco\n"},{"id":"162171","messageId":"7v7hcp2vi6.fsf@alter.siamese.dyndns.org","threadId":"26591","inReplyTo":"20110224112246.3f811ac2@glyph","subject":"Re: Why doesn't git commit -a track new files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-24T17:27:29Z","receivedAt":"2011-02-24T17:27:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco <netuse@lavabit.com> writes:\n\n> I'm new to git and a bit confused about how some commands work.\n>\n> git add .                    -- Adds everything *but* deleted files\n> git add -A                   -- Adds everything\n> git commit -a -m \"whatever\"  -- Commits everything *but* new files\n>\n> I don't understand why there's not switch (is there?) for commit to commit new\n> and deleted files, like -A for git add?\n\nHistorical accident.  In the early days of git, there was no .gitignore\nmechanism, so a mode that operates on everything under the working tree\nwas almost always an undesired thing to have (think *.o files).\n\nThen .gitignore mechanism came, and \"add .\" has become usable.  But\n\"commit -a\" has been widely used way before that.\n\nIf you look at \"commit -a\" within that context, you would understand why\nit should only look at the paths git knows about.\n\nOf course, \"add -A\" is a much later invention.  The option was named \"-A\"\nwith capital letter, even though there is no \"add -a\".\n\nThis was because I knew we would eventually want to have \"commit -A\" that\ngrabs everything and new files (honoring the gitignore mechanism), and\naimed for consistency between \"add -A\" that I was adding, and \"commit -A\"\nthat was yet to be written.  See 3ba1f11 (git-add --all: add all files,\n2008-07-19).\n\nI think it now is sensible to add \"commit -A\" if somebody is inclined to\ndo so.  Nobody felt the need for it strongly enough to do so, it seems.\n"},{"id":"162177","messageId":"20110224194514.2ca47772@glyph","threadId":"26591","inReplyTo":"7v7hcp2vi6.fsf@alter.siamese.dyndns.org","subject":"Re: Why doesn't git commit -a track new files","fromName":"Marco","fromEmail":"netuse@lavabit.com","sentAt":"2011-02-24T18:45:14Z","receivedAt":"2011-02-24T18:45:14Z","isPatch":false,"sender":{"key":"netuse@lavabit.com","avatar":null},"body":"On 2011-02-24 Junio C Hamano <gitster@pobox.com> wrote:\n\n> > I don't understand why there's not switch (is there?) for commit to\n> > commit new and deleted files, like -A for git add?\n> \n> Historical accident.  In the early days of git, there was no .gitignore\n> mechanism, so a mode that operates on everything under the working tree\n> was almost always an undesired thing to have (think *.o files).\n> \n> Then .gitignore mechanism came, and \"add .\" has become usable.  But\n> \"commit -a\" has been widely used way before that.\n> \n> If you look at \"commit -a\" within that context, you would understand why\n> it should only look at the paths git knows about.\n> \n> Of course, \"add -A\" is a much later invention.  The option was named \"-A\"\n> with capital letter, even though there is no \"add -a\".\n> \n> This was because I knew we would eventually want to have \"commit -A\" that\n> grabs everything and new files (honoring the gitignore mechanism), and\n> aimed for consistency between \"add -A\" that I was adding, and \"commit -A\"\n> that was yet to be written.  See 3ba1f11 (git-add --all: add all files,\n> 2008-07-19).\n> \n> I think it now is sensible to add \"commit -A\" if somebody is inclined to\n> do so.  Nobody felt the need for it strongly enough to do so, it seems.\n\nThank you for the detailed explanation.\n\nTo sum this up: -A would be a nice-to-have feature but it's not necessary to\nimplement since we have add -A. But if I'm willing to implement it myself I'm\nfree to do that.\n\n\nRegards\nMarco\n"},{"id":"162206","messageId":"buozkpk91nf.fsf@dhlpc061.dev.necel.com","threadId":"26591","inReplyTo":"4D6672F7.4020101@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2011-02-25T04:30:28Z","receivedAt":"2011-02-25T04:30:28Z","isPatch":false,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n>> git add -A && git commit -m \"Message\"\n>\n> \"commit -a\" is much like \"add -u\", at least when used without file\n> arguments (\"pathspec\").\n>\n> \"commit -A\" does not exist, so that \"git add -A && git commit\" is your\n> only way.\n>\n> Why does it not exist? Because you should at least\n> \"git add -A && git status && behappy && git commit\".\n\nThe exact same argument applies to \"git commit -a\" of course, but it's\nstill supported.  Why?  Because it's a nice convenience for many common\nsituations.  It isn't the least bit unsafe if one does git status _first_.\n\n> Also, \"-A\" supports a very \"un-gitty\" way of using git. This makes it\n> unlikely that someone cares to implement it... (By \"un-gitty\" I don't\n> mean a matter of personal taste, but a matter of fruitful habits.)\n\nNonsense.\n\nThe index is a great idea, and cool and useful in many situations; I use\nit heavily, and wish other systems had something like it.  But there's\nnothing \"un-gitty\" or \"unfruitful\" about directly commiting sometimes.\n\nFor the record, I usually use the index, but sometimes when the changes\nare simple, I'll use shortcuts like \"commit -a\", because they're handy.\nTypically I'll do \"git status\" _first_, check that everything's kosher,\nand then do \"git commit -a ...\".  If \"git commit -A\" existed, I'd use\nthat in the same way.\n\n-Miles\n\n-- \nMayonnaise, n. One of the sauces that serve the French in place of a state\nreligion.\n"},{"id":"162215","messageId":"4D676B97.3000204@drmicha.warpmail.net","threadId":"26591","inReplyTo":"buozkpk91nf.fsf@dhlpc061.dev.necel.com","subject":"Re: Why doesn't git commit -a track new files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-02-25T08:43:03Z","receivedAt":"2011-02-25T08:43:03Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Miles Bader venit, vidit, dixit 25.02.2011 05:30:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n>>> git add -A && git commit -m \"Message\"\n>>\n>> \"commit -a\" is much like \"add -u\", at least when used without file\n>> arguments (\"pathspec\").\n>>\n>> \"commit -A\" does not exist, so that \"git add -A && git commit\" is your\n>> only way.\n>>\n>> Why does it not exist? Because you should at least\n>> \"git add -A && git status && behappy && git commit\".\n> \n> The exact same argument applies to \"git commit -a\" of course, but it's\n\nNo, because you are usually more aware of tracked files than of\nuntracked ones, especially in subdirs.\n\n> still supported.  Why?  Because it's a nice convenience for many common\n> situations.  It isn't the least bit unsafe if one does git status _first_.\n\nThat is why I recommended to use git status first. But \"-A\" is still\ndifferent, because (depending on your config) git status does not show\nyou files in untracked subdirs.\n\n>> Also, \"-A\" supports a very \"un-gitty\" way of using git. This makes it\n>> unlikely that someone cares to implement it... (By \"un-gitty\" I don't\n>> mean a matter of personal taste, but a matter of fruitful habits.)\n> \n> Nonsense.\n> \n> The index is a great idea, and cool and useful in many situations; I use\n> it heavily, and wish other systems had something like it.  But there's\n> nothing \"un-gitty\" or \"unfruitful\" about directly commiting sometimes.\n\nAnd you can do that with \"git add -A\" followed by \"git commit\".\n\n> For the record, I usually use the index, but sometimes when the changes\n\nSo if you use the index usually, it must be a fruitful habit. That\nrenders your \"Nonsense\" remark rather nonsensical.\n\n> are simple, I'll use shortcuts like \"commit -a\", because they're handy.\n> Typically I'll do \"git status\" _first_, check that everything's kosher,\n> and then do \"git commit -a ...\".  If \"git commit -A\" existed, I'd use\n> that in the same way.\n\nIt almost exists (add -A plus commit), and you carefully chose to ignore\nmy earlier posts about the implementation strategy leading to \"commit\n-A\" (after I had looked at the details of the code - have you?), of\ncourse, because otherwise the content of your post would be baseless;\nthe tone is anyway. No surprise here either.\n\nJust for those wondering:\n\nThe \"habit problem\" with \"commit -A\" is that, potentially, it keeps\nnewcomers from learning vcs/git at all. It's a (too) wonderful way of\nnot having to worry even about the concept of \"files under version\ncontrol\" - this has nothing to do with using the index or not (that\nwould be the \"-a\" thingy). Even \"svn commit\" does not do what \"git\ncommit -A\" would.\n\nNo more posts from me on this subthread, it's just not worth it.\nMichael\n"},{"id":"162216","messageId":"4D676D99.2010600@drmicha.warpmail.net","threadId":"26591","inReplyTo":"20110224160932.GC30275@sigill.intra.peff.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-02-25T08:51:37Z","receivedAt":"2011-02-25T08:51:37Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jeff King venit, vidit, dixit 24.02.2011 17:09:\n> On Thu, Feb 24, 2011 at 05:01:55PM +0100, Michael J Gruber wrote:\n> \n>>>> - hom. interface: allow \"-a pathspec\" for commit\n>>>\n>>> What would it do? It would just behave like \"git commit -i\n>>> pathspec\"?\n>>\n>> It should do what \"-u pathspec\" does for add: limit \"all tracked\" to the\n>> pathspec. I know it's the same as without \"-a\", but why bail out on it?\n> \n> Without \"-a\", we do \"git commit -o\", which is slightly different with\n> respect to stuff in the index.  In the case of:\n> \n>   git add -u <path> && git commit\n> \n> we will add new changes from <path>, and then commit them along with\n> whatever was already in the index.\n> \n> With:\n> \n>   git commit <path>\n> \n> We will commit _just_ the changes in <path>, regardless of what is in\n> the index.\n> \n> I assumed that:\n> \n>  git commit -a <path>\n> \n> would behave more like the \"git add -u <path>\" case; add new stuff to\n> the index from <path>, and then commit those changes plus whatever was\n> already in the index.\n\nYes, you're right. I haven't wrapped my brain completely around those\nmixed cases yet (changes in index + pathspec argument). My aim is that\n\n\"git commit <addoptions> <commitoptions> [<pathspec>]\"\n\nwould be equivalent to (the atomic version of)\n\n\"git add <addoptions> [<pathspec>] && git commit <commitoptions>\"\n\nand that is difficult because currently, pathspecs are \"limiting\" for\ncommit and \"additive\" for add without -u. I mean, I don't want to break\nanything, at least not before 1.8.0..\n\n>> I've done all the careful planning already, laid out in nice steps. Now\n>> it's your time ;)\n> \n> Heh. Transitioning to management, I see.\n\nStill in negotiations ;)\n\n> -Peff\n\nMichael\n"},{"id":"162217","messageId":"20110225090126.GA16861@sigill.intra.peff.net","threadId":"26591","inReplyTo":"4D676D99.2010600@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-02-25T09:01:26Z","receivedAt":"2011-02-25T09:01:26Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Feb 25, 2011 at 09:51:37AM +0100, Michael J Gruber wrote:\n\n> > I assumed that:\n> > \n> >  git commit -a <path>\n> > \n> > would behave more like the \"git add -u <path>\" case; add new stuff to\n> > the index from <path>, and then commit those changes plus whatever was\n> > already in the index.\n> \n> Yes, you're right. I haven't wrapped my brain completely around those\n> mixed cases yet (changes in index + pathspec argument). My aim is that\n> \n> \"git commit <addoptions> <commitoptions> [<pathspec>]\"\n> \n> would be equivalent to (the atomic version of)\n> \n> \"git add <addoptions> [<pathspec>] && git commit <commitoptions>\"\n> \n> and that is difficult because currently, pathspecs are \"limiting\" for\n> commit and \"additive\" for add without -u. I mean, I don't want to break\n> anything, at least not before 1.8.0..\n\nI don't think there is any breakage with \"-a\" (or \"-A\") there, as you\nare adding a new mode of operation that currently doesn't work (e.g.,\nright now \"git commit -a foo\" will die). The only thing that would not\nwork is trying to make:\n\n  git add <path> && git commit\n\nthe same as\n\n  git commit <path>\n\nBut I am not sure that is a good idea anyway. Yes, it is a little\ninconsistent with the other forms, but I think it is generally what you\nwant (which is why the default for commit with paths switched from \"-i\"\nto \"-o\" long ago).\n\n-Peff\n"},{"id":"162219","messageId":"4D677054.9050908@drmicha.warpmail.net","threadId":"26591","inReplyTo":"20110225090126.GA16861@sigill.intra.peff.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-02-25T09:03:16Z","receivedAt":"2011-02-25T09:03:16Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jeff King venit, vidit, dixit 25.02.2011 10:01:\n> On Fri, Feb 25, 2011 at 09:51:37AM +0100, Michael J Gruber wrote:\n> \n>>> I assumed that:\n>>>\n>>>  git commit -a <path>\n>>>\n>>> would behave more like the \"git add -u <path>\" case; add new stuff to\n>>> the index from <path>, and then commit those changes plus whatever was\n>>> already in the index.\n>>\n>> Yes, you're right. I haven't wrapped my brain completely around those\n>> mixed cases yet (changes in index + pathspec argument). My aim is that\n>>\n>> \"git commit <addoptions> <commitoptions> [<pathspec>]\"\n>>\n>> would be equivalent to (the atomic version of)\n>>\n>> \"git add <addoptions> [<pathspec>] && git commit <commitoptions>\"\n>>\n>> and that is difficult because currently, pathspecs are \"limiting\" for\n>> commit and \"additive\" for add without -u. I mean, I don't want to break\n>> anything, at least not before 1.8.0..\n> \n> I don't think there is any breakage with \"-a\" (or \"-A\") there, as you\n> are adding a new mode of operation that currently doesn't work (e.g.,\n> right now \"git commit -a foo\" will die). The only thing that would not\n> work is trying to make:\n> \n>   git add <path> && git commit\n> \n> the same as\n> \n>   git commit <path>\n> \n> But I am not sure that is a good idea anyway. Yes, it is a little\n> inconsistent with the other forms, but I think it is generally what you\n> want\n\nVery true. I guess that nails our specification.\n\n> (which is why the default for commit with paths switched from \"-i\"\n> to \"-o\" long ago).\n\n...before my time (or under my radar).\n\nEquivalent options and slightly different defaults should be fine, just\nas you explained.\n\n\"-i\" is implicit for \"add\" and \"-o\" is nonsensical/unnecessary (there is\nno temp. index for add, but there is reset), so those need not be covered.\n\nMichael\n"},{"id":"162221","messageId":"20110225090908.GA17145@sigill.intra.peff.net","threadId":"26591","inReplyTo":"4D677054.9050908@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-02-25T09:09:08Z","receivedAt":"2011-02-25T09:09:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Feb 25, 2011 at 10:03:16AM +0100, Michael J Gruber wrote:\n\n> > (which is why the default for commit with paths switched from \"-i\"\n> > to \"-o\" long ago).\n> \n> ...before my time (or under my radar).\n\nAlmost before my time, too. See 130fcca (git-commit: revamp the\ngit-commit semantics., 2006-02-05).\n\n-Peff\n"},{"id":"162228","messageId":"4D678137.7060707@drmicha.warpmail.net","threadId":"26591","inReplyTo":"20110224194514.2ca47772@glyph","subject":"Re: Why doesn't git commit -a track new files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-02-25T10:15:19Z","receivedAt":"2011-02-25T10:15:19Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Marco venit, vidit, dixit 24.02.2011 19:45:\n> On 2011-02-24 Junio C Hamano <gitster@pobox.com> wrote:\n> \n>>> I don't understand why there's not switch (is there?) for commit to\n>>> commit new and deleted files, like -A for git add?\n>>\n>> Historical accident.  In the early days of git, there was no .gitignore\n>> mechanism, so a mode that operates on everything under the working tree\n>> was almost always an undesired thing to have (think *.o files).\n>>\n>> Then .gitignore mechanism came, and \"add .\" has become usable.  But\n>> \"commit -a\" has been widely used way before that.\n>>\n>> If you look at \"commit -a\" within that context, you would understand why\n>> it should only look at the paths git knows about.\n>>\n>> Of course, \"add -A\" is a much later invention.  The option was named \"-A\"\n>> with capital letter, even though there is no \"add -a\".\n>>\n>> This was because I knew we would eventually want to have \"commit -A\" that\n>> grabs everything and new files (honoring the gitignore mechanism), and\n>> aimed for consistency between \"add -A\" that I was adding, and \"commit -A\"\n>> that was yet to be written.  See 3ba1f11 (git-add --all: add all files,\n>> 2008-07-19).\n>>\n>> I think it now is sensible to add \"commit -A\" if somebody is inclined to\n>> do so.  Nobody felt the need for it strongly enough to do so, it seems.\n> \n> Thank you for the detailed explanation.\n> \n> To sum this up: -A would be a nice-to-have feature but it's not necessary to\n> implement since we have add -A. But if I'm willing to implement it myself I'm\n> free to do that.\n\nMarco, please don't cull cc on this list. I haven't been aware of this\nnew subthread nor your answer in the other one (being culled).\n\nYour questions have been answered in the subthread with Jeff already,\nand we've laid out a way forward for the implementation.\n\nMichael\n"},{"id":"162245","messageId":"7v8vx4camu.fsf@alter.siamese.dyndns.org","threadId":"26591","inReplyTo":"20110224194514.2ca47772@glyph","subject":"Re: Why doesn't git commit -a track new files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-25T17:00:25Z","receivedAt":"2011-02-25T17:00:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco <netuse@lavabit.com> writes:\n\n> To sum this up: -A would be a nice-to-have feature but it's not necessary to\n> implement since we have add -A. But if I'm willing to implement it myself I'm\n> free to do that.\n\n\"It's not necessary to implement since we have add -A\" is not what I said.\n\"I've shown the way long time ago, but that hasn't happened yet\" was.\n\nLuckily, it seems that it is changing now ;-).\n"},{"id":"162291","messageId":"87oc5zi9am.fsf@catnip.gol.com","threadId":"26591","inReplyTo":"4D676B97.3000204@drmicha.warpmail.net","subject":"Re: Why doesn't git commit -a track new files","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2011-02-26T06:45:05Z","receivedAt":"2011-02-26T06:45:05Z","isPatch":false,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n> No more posts from me on this subthread, it's just not worth it.\n\nIndeed, after sending my reply I read the rest of the messages on the\nthread, and wished I hadn't replied at all.\n\nOh well; \"read the whole thread before replying\" is a lesson that needs\nto be relearned occasionally I suppose...\n\n-Miles\n\n-- \nIs it true that nothing can be known?  If so how do we know this?  -Woody Allen\n"}]}