{"thread":{"id":"15412","subject":"Is incremental staging really the common mode? [Was: Re: Git User's Survey 2008 partial summary, part 4 - how do we use Git]","startedAt":"2008-09-07T20:17:23Z","lastAt":"2008-09-08T00:45:24Z","messageCount":4,"participants":["Elijah Newren","david@lang.hm","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"90003","messageId":"51419b2c0809071317g6f916b19p1c2792595be58047@mail.gmail.com","threadId":"15412","inReplyTo":null,"subject":"Is incremental staging really the common mode? [Was: Re: Git User's Survey 2008 partial summary, part 4 - how do we use Git]","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2008-09-07T20:17:23Z","receivedAt":"2008-09-07T20:17:23Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nOn Sat, Sep 6, 2008 at 4:17 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> This is partial summary of Git User's Survey 2008 after more that 2000\n> (yes, that is more than _two thousands_ responses) just after the 6 days\n> of running the survey.  It is based on \"Analysis\" page for this survey:\n>  http://www.survs.com/shareResults?survey=M3PIVU72&rndm=OKJQ45LAG8\n>\n<snip>\n> git add + git commit   | 65% (1012)\n> git commit -a          | 63%  (981)\n<snip>\n> Analysis: strangely \"git add + git commit\" is slightly more used than\n> \"git commit -a\"; I would suspect that \"git commit -a\" would dominate a\n> bit over other forms of committing.  What is for me more suprising is\n> that \"git commit <file>...\" has such large presence in often used\n> commands; I would think that it should be mostly used as 'sometimes'\n> command.\n\nDoes this data really compare usage of incremental staging of commits\nvs. non-incremental all-changes-included commits?\n\nYou didn't have a git add + git commit -a, so if people feel like they\nhave brand new files to add to the repository often, adding new files\nalone would cause them to mark the git add + git commit box as \"often\"\n(or maybe I was the only one dumb enough to think this was\nsignificantly related to adding new files?).  That alone could account\nfor the difference, assuming others misunderstood as I did.\n\nAlso, you didn't have a continuum of \"often\" to compare between.  For\nexample, I marked \"add -p\" as something I use often (btw, a huge\nthanks to whoever added interactive hunk editing to that command),\nthough that doesn't mean I use it as much as commit -a.  I would say\nthat I use both add and add -p forms of incremental staging \"often\",\nyet both combined with commit are still far less than my usage of\ncommit -a.\n\nThere may be another issue at play here too: some may have come to\nfeel that usage of commit -a is error prone and better to avoid.\nMaybe I'm the only one, but every once in a while I start\nincrementally staging a commit, forget about it, come back to the\nproject later, and then do a commit -a out of habit (since commit -a\nis so common).  Oops -- there goes all my careful staging work!\n\nActually, I'm really not hit by that last bug anymore, since EasyGit\nprevents it for me.  But it's an annoyance of mine with core git.\n\n\nThis topic does make me wonder whether I am missing something, though,\nparticularly due to Junio's recent comments about diff defaults[1]:\n\n'If they understand \"the meaning of the index\", not just as literal reading\nof the manual page \"it is a staging area to prepare for the next commit\",\nbut including the reason why there is a \"staging area\" and how it is to be\nused, they would reach the conclusion that \"diff by default will show the\nleftover from incremental staging and it is the right thing\".'\n\nDespite believing that I understand the index pretty well and use it\noften, and love being able to get the unstaged portion of my changes,\nI never came to any such conclusion and it hit me by surprise.  There\nseems to be an assumption in what Junio has written that incremental\nstaging is the common mode of operation; given that assumption I can\nbuy the rest of his argument.  But that seems at odds with my\nperception of the default mode of operation, which is at least\npartially backed up by Linus' admission that commit -a is the common\ncase.[2]  Is incremental staging really the common mode of operation?\n\nAm I still missing something fundamental about the index?\n\n\nElijah\n\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/92820\n\n[2] http://marc.info/?l=git&m=116493011406600&w=2\n"},{"id":"90030","messageId":"alpine.DEB.1.10.0809071729310.8096@asgard.lang.hm","threadId":"15412","inReplyTo":"51419b2c0809071317g6f916b19p1c2792595be58047@mail.gmail.com","subject":"Re: Is incremental staging really the common mode? [Was: Re: Git User's Survey 2008 partial summary, part 4 - how do we use Git]","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-09-08T00:32:09Z","receivedAt":"2008-09-08T00:32:09Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"On Sun, 7 Sep 2008, Elijah Newren wrote:\n\n> Hi,\n>\n> On Sat, Sep 6, 2008 at 4:17 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n>> This is partial summary of Git User's Survey 2008 after more that 2000\n>> (yes, that is more than _two thousands_ responses) just after the 6 days\n>> of running the survey.  It is based on \"Analysis\" page for this survey:\n>>  http://www.survs.com/shareResults?survey=M3PIVU72&rndm=OKJQ45LAG8\n>>\n> <snip>\n>> git add + git commit   | 65% (1012)\n>> git commit -a          | 63%  (981)\n> <snip>\n>> Analysis: strangely \"git add + git commit\" is slightly more used than\n>> \"git commit -a\"; I would suspect that \"git commit -a\" would dominate a\n>> bit over other forms of committing.  What is for me more suprising is\n>> that \"git commit <file>...\" has such large presence in often used\n>> commands; I would think that it should be mostly used as 'sometimes'\n>> command.\n>\n> Does this data really compare usage of incremental staging of commits\n> vs. non-incremental all-changes-included commits?\n>\n> You didn't have a git add + git commit -a, so if people feel like they\n> have brand new files to add to the repository often, adding new files\n> alone would cause them to mark the git add + git commit box as \"often\"\n> (or maybe I was the only one dumb enough to think this was\n> significantly related to adding new files?).  That alone could account\n> for the difference, assuming others misunderstood as I did.\n\nalso, how many are doing 'git add .' or 'git add *' followed by git \ncommit?\n\nthere were several commands listed that I have never heard of before and \nwill want to research to see what they do to see if I should be using \nthem.\n\nnext survey it would be handy to have links from each command you are \nasking about to a page that describes what it does and why you would use \nit (_not_ just a link to the man page for git add in the example above)\n\nDavid Lang\n"},{"id":"90032","messageId":"7v1vzvjwqz.fsf@gitster.siamese.dyndns.org","threadId":"15412","inReplyTo":"alpine.DEB.1.10.0809071729310.8096@asgard.lang.hm","subject":"Re: Is incremental staging really the common mode?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-08T00:40:20Z","receivedAt":"2008-09-08T00:40:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"david@lang.hm writes:\n\n> also, how many are doing 'git add .' or 'git add *' followed by git\n> commit?\n\nEverybody who starts a new history from scratch from an existing tarball\nwould be doing this at least once ;-)\n\n> there were several commands listed that I have never heard of before\n> and will want to research to see what they do to see if I should be\n> using them.\n\nThe commands singled out were either (1) ancient, nobody should be using\nthem, and we would love to prove that nobody is using them anymore so that\nwe can remove them, or (2) reasonably new inventions that would help\ncommon situations more than the stock Porcelain we have had for years, to\nsee if they are already widely adopted.\n\nPerhaps somebody (or group of people, taking turns) should post a \"git\ntrick of the week\" series to this mailing list?\n"},{"id":"90034","messageId":"alpine.DEB.1.10.0809071742470.8096@asgard.lang.hm","threadId":"15412","inReplyTo":"7v1vzvjwqz.fsf@gitster.siamese.dyndns.org","subject":"Re: Is incremental staging really the common mode?","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-09-08T00:45:24Z","receivedAt":"2008-09-08T00:45:24Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"On Sun, 7 Sep 2008, Junio C Hamano wrote:\n\n> david@lang.hm writes:\n>\n>> also, how many are doing 'git add .' or 'git add *' followed by git\n>> commit?\n>\n> Everybody who starts a new history from scratch from an existing tarball\n> would be doing this at least once ;-)\n>\n>> there were several commands listed that I have never heard of before\n>> and will want to research to see what they do to see if I should be\n>> using them.\n>\n> The commands singled out were either (1) ancient, nobody should be using\n> them, and we would love to prove that nobody is using them anymore so that\n> we can remove them, or (2) reasonably new inventions that would help\n> common situations more than the stock Porcelain we have had for years, to\n> see if they are already widely adopted.\n\nit would be really good to indicate which is which. I spotted several \nthings that looked like they would help me, but I have no idea which ones \nI should use and which I shouldn't\n\n> Perhaps somebody (or group of people, taking turns) should post a \"git\n> trick of the week\" series to this mailing list?\n\nthat would be a good idea. I would suggest also putting them on the wiki \nand (if possible) package them up periodicly as a fortune file.\n\nDavid Lang\n"}]}