{"thread":{"id":"43135","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","startedAt":"2006-12-06T00:41:29Z","lastAt":"2006-12-09T03:58:50Z","messageCount":38,"participants":["J. Bruce Fields","Junio C Hamano","Daniel Barkalow","Johannes Schindelin","Jakub Narebski","Tom Prince","Graham Percival","Han-Wen Nienhuys"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"296806","messageId":"457611B9.9020907@gmail.com","threadId":"43135","inReplyTo":"4574BF70.8070100@lilypond.org","subject":"git newbie problems","fromName":"Graham Percival","fromEmail":"gpermus@gmail.com","sentAt":"2006-12-06T00:41:29Z","receivedAt":"2006-12-06T00:41:29Z","isPatch":false,"sender":{"key":"gpermus@gmail.com","avatar":null},"body":"Greetings,\n\nI'm posting these problems at Han-Wen and Dscho's insistence.  I'm the \ndocumentation editor for GNU/LilyPond, so I'm reluctant to criticize \nother project's documentation unless I spend an hour or more seriously \nreading it.  I'm quite willing to admit that I never seriously tried to \nread the docs on the overall theory of git (branches, repo, etc); I just \nflailed around looking for magic commands to make things work.  By \"make \nthings work\", I mean imitating my work style with cvs:\n\ncvs co blah blah  (which I simply copy and paste from savannah)\nwhile (true) {\n   cvs update          // get changes that happened overnight\n   vi foo/bar/baz.txt  // or whatever editing commands you do\n   make; make web      // or whatever testing commands you do\n   cvs update          // get latest changes to prepare for\n                       // uploading my changes.\n   cvs ci foo/bar/baz.txt  // upload changes\n}\n\nOnce or twice a year I'll do \"cvs diff\" or \"cvs add\", but all I really \nwant are the above commands.  I figured that this should be really easy \nto do, so I kept on skimming through the docs, trying to find the \nequivalent of these really easy commands.  (note that I was reading the \n\"tutorial introduction to git\")\n\nI should add that I've received help on the lilypond-devel list; I'm \nposting this in case it helps future development for git docs, not \nbecause I need more help to use git.\n\nThis case was particularly difficult because the very first time I tried\nto commit... err... push... err... \"make my doc changes available to\neverybody else\" (whatever the right term is), there was this merge problem.\n\n\n\nMERGE PROBLEM\n\nTwo people (me and another person) edited the same line on\nDocumentation/user/advanced.itely at the same time.  (note that this \nfile has existed for over a year; it's not a new file)  When I tried to \nget the most recent changes, I'm greeted with this:\n...\nTrying really trivial in-index merge...\nDocumentation/user/advanced-notation.itely: needs merge\nfatal: you need to resolve your current index first\nNope.\nMerging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2\nMerging:\n038b7fc Misc small updates (trying to make git work).\nc21d3f3 Merge branch 'master' of\nssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond\nfound 1 common ancestor(s):\n84219bb don't have input/templates/ any longer.\nfatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\nNo merge strategy handled the merge.\n\n\nAs a git newbie, I'm quite confused.  OK, there's no merge strategy...\nso what do I do now?  With cvs, the changes would be dumped into the\nfile.  I look at the file, found the conflict, and tried it again.  I\ngot the same error message, and then it occurred to me that although I\nchanged the files in my ~/usr/src/lilypond, git might be storing these\nfiles somewhere else.  So I tried\n\n$ git commit Documentation/user/advanced-notation.itely\nCannot do a partial commit during a merge.\nYou might have meant to say 'git commit -i paths...', perhaps?\n\n... eh?  I'm trying to fix this so that you _can_ merge!  Regardless,\nwhen I tried to update again, I get\n\n$ git pull gnu master\n...\nTrying really trivial in-index merge...\nfatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\nNope.\nMerging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2\nMerging:\n038b7fc Misc small updates (trying to make git work).\nc21d3f3 Merge branch 'master' of\nssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond\nfound 1 common ancestor(s):\n84219bb don't have input/templates/ any longer.\nfatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\nNo merge strategy handled the merge.\n\n\nNow I'm totally confused, because I definitely haven't touched .gitignore.\n\n\nSUGGESTIONS\n\nThe \"tutorial introduction to git\" looks like a nice document, but it\nassumes that you are in control of the project.  For users who aren't in\ncontrol (ie me) this is a problem, because it starts me skimming.\n\"Importing a project\"... nah, that's not me.  \"Merging branches\"... I\ndon't care; I'm going to shove everything into the main branch.  \"Using\ngit for collaboration\"... hmm, maybe this is the stuff I need to read.\nBut by this point, I've already skimmed through five screens of info, so\nI'm not reading very carefully.\n\nIt would be nice to have an accompanying \"tutorial introduction to\ncontributing with git\" for users (like me) who are not in control of a \nproject.\n\nFinally, it would be really nice if there was some mention of \"resolving\nmerge problems\" in the tutorial (both in the current one and any new docs).\n\nCheers,\n- Graham Percival\n\n"},{"id":"297042","messageId":"el55to$952$1@sea.gmane.org","threadId":"43135","inReplyTo":"457611B9.9020907@gmail.com","subject":"Re: git newbie problems","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-06T01:23:06Z","receivedAt":"2006-12-06T01:23:06Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Graham Percival wrote:\n\n> Greetings,\n> \n> I'm posting these problems at Han-Wen and Dscho's insistence.  I'm the \n> documentation editor for GNU/LilyPond, so I'm reluctant to criticize \n> other project's documentation unless I spend an hour or more seriously \n> reading it.  I'm quite willing to admit that I never seriously tried to \n> read the docs on the overall theory of git (branches, repo, etc); I just\n\nBranches are very useful concept. And I really like the idea of branches in\ngit (the underlying concept of branch as lineage) and its implementation.\nBut because CVS had seriously screwed implementation of branches, you\nprobably didn't use it.\n\n> flailed around looking for magic commands to make things work.  By \"make \n> things work\", I mean imitating my work style with cvs:\n\nPerhaps it would be better to at least read cvs-migration.txt\n  http://kernel.org/pub/software/scm/git/docs/cvs-migration.html\nand all tutorials.\n\n> cvs co blah blah  (which I simply copy and paste from savannah)\n> while (true) {\n>    cvs update          // get changes that happened overnight\n\n\"git pull\", or \"git fetch\". \"git pull\" is more like in CVS, because it\nmerges the changes that happened overninght with your work.\n\n>    vi foo/bar/baz.txt  // or whatever editing commands you do\n>    make; make web      // or whatever testing commands you do\n\nThose steps do not depend on version control used.\n\n>    cvs update          // get latest changes to prepare for\n>                        // uploading my changes.\n>    cvs ci foo/bar/baz.txt  // upload changes\n\nWith git you do this sequence not in braindead CVS \"update then commit\"\nwhich leads to rare commits (because you don't have time to resolve merge\nconflicts for example), but commit then upload changes.\n\n\"git commit -a\" to commit changes (the standard format of commit message\ndescribing the change expected by history viewers is to write short\none-line description of changes, separate by empty line from longer\ndescription if it is needed (it usually is): see\n  http://git.or.cz/gitwiki/CommitMessageConventions\n(and also other pages on GitDocumentation page at GitWiki as well)).\n\nThen \"git push\" to propagate your changes (or if you don't have permissions\nto push into repository, \"git format-patch HEAD^..\" and \"git send-mail\" to\npropagate your changes via email).\n\n> }\n> \n> Once or twice a year I'll do \"cvs diff\" or \"cvs add\", but all I really \n> want are the above commands.  I figured that this should be really easy \n> to do, so I kept on skimming through the docs, trying to find the \n> equivalent of these really easy commands.  (note that I was reading the \n> \"tutorial introduction to git\")\n\nThere are some commands which CVS didn't have, and which are very useful\nwith git: I'm talking here about \"git show\" (show latest change), \"git\nlog\" (show kind of changelog), and gitk (graphical history viewer) or qgit\n(alternate graphical history viewer in Qt).\n\nIt is also of note that you can move and rename files, soemthing CVS had\nmuch problems with.\n \n> I should add that I've received help on the lilypond-devel list; I'm \n> posting this in case it helps future development for git docs, not \n> because I need more help to use git.\n> \n> This case was particularly difficult because the very first time I tried\n> to commit... err... push... err... \"make my doc changes available to\n> everybody else\" (whatever the right term is), there was this merge\n> problem. \n> \n> \n> \n> MERGE PROBLEM\n> \n> Two people (me and another person) edited the same line on\n> Documentation/user/advanced.itely at the same time.  (note that this \n> file has existed for over a year; it's not a new file)  When I tried to \n> get the most recent changes, I'm greeted with this:\n> ...\n> Trying really trivial in-index merge...\n> Documentation/user/advanced-notation.itely: needs merge\n> fatal: you need to resolve your current index first\n> Nope.\n> Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2\n> Merging:\n> 038b7fc Misc small updates (trying to make git work).\n> c21d3f3 Merge branch 'master' of\n> ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond\n> found 1 common ancestor(s):\n> 84219bb don't have input/templates/ any longer.\n> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\n> No merge strategy handled the merge.\n>\n> \n> As a git newbie, I'm quite confused.  OK, there's no merge strategy...\n> so what do I do now?  With cvs, the changes would be dumped into the\n> file.  I look at the file, found the conflict, and tried it again.  I\n> got the same error message, and then it occurred to me that although I\n> changed the files in my ~/usr/src/lilypond, git might be storing these\n> files somewhere else.\n\nYes, the git error messages certainly needs to be made more user-friendly.\nWhat git says here that one version has '.gitignore' file handled by version\ncontrol, and second has it outside version control. At least I think what\nit does. \"git ls-files --unmerged\" or \"git diff --merge --summary\" should\nshow 'true conflicts'.\n\nBy the way, which version of git do you use? I think this particular check\n(if it is the case of this error) was relaxed.\n\n> So I tried\n> $ git commit Documentation/user/advanced-notation.itely\n> Cannot do a partial commit during a merge.\n> You might have meant to say 'git commit -i paths...', perhaps?\n\nHint: usually \"git reset\" or even \"git reset --hard\" *warning: the latter\nwould overwrite your changes since last commit! use with care) is what you\nwant to do to 'clean up' after some interrupted command.\n\n> ... eh?  I'm trying to fix this so that you _can_ merge!  Regardless,\n> when I tried to update again, I get\n> \n> $ git pull gnu master\n> ...\n> Trying really trivial in-index merge...\n> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\n> Nope.\n> Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2\n> Merging:\n> 038b7fc Misc small updates (trying to make git work).\n> c21d3f3 Merge branch 'master' of\n> ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond\n> found 1 common ancestor(s):\n> 84219bb don't have input/templates/ any longer.\n> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\n> No merge strategy handled the merge.\n> \n> \n> Now I'm totally confused, because I definitely haven't touched .gitignore.\n\nI'm guessing that \"git add .gitignore\", \"git commit -a -m\n'Added .gitignore'\" before retyring pull/push would help in such situation. \n\n> SUGGESTIONS\n> \n> The \"tutorial introduction to git\" looks like a nice document, but it\n> assumes that you are in control of the project.  For users who aren't in\n> control (ie me) this is a problem, because it starts me skimming.\n> \"Importing a project\"... nah, that's not me.  \"Merging branches\"... I\n> don't care; I'm going to shove everything into the main branch.  \"Using\n> git for collaboration\"... hmm, maybe this is the stuff I need to read.\n> But by this point, I've already skimmed through five screens of info, so\n> I'm not reading very carefully.\n> \n> It would be nice to have an accompanying \"tutorial introduction to\n> contributing with git\" for users (like me) who are not in control of a \n> project.\n> \n> Finally, it would be really nice if there was some mention of \"resolving\n> merge problems\" in the tutorial (both in the current one and any new\n> docs). \n\nCheck out \"[DRAFT] Branching and merging with git\" thread\n\n  Message-ID: <20061116221701.4499.qmail@science.horizon.com>\n  http://permalink.gmane.org/gmane.comp.version-control.git/31625\n  http://thread.gmane.org/gmane.comp.version-control.git/31625/ \n\nwhich I hope would end as Documentation/tutorial-3.txt. Or you can read jdl\npresentation from OLS; check out GitLinks / GitDocumentation at GitWiki:\n  \n  http://git.or.cz/gitwiki/\n\n> (please CC me as I am not subscribed to the mailist)\n\nI also am not subsribed to the mailing list, but read the list via GMane\nNNTP (news, Usenet) interface: see http://git.or.cz/gitwiki/GitCommunity\n\n  nntp://news.gmane.org/gmane.comp.version-control.git\n\nP.S. For wuick answers to \"what to do now\" questions you might use #git\nchannel on FreeNode.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"298046","messageId":"7v4ps9byca.fsf@assigned-by-dhcp.cox.net","threadId":"43135","inReplyTo":"457611B9.9020907@gmail.com","subject":"Re: git newbie problems","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-06T01:35:33Z","receivedAt":"2006-12-06T01:35:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Graham Percival <gpermus@gmail.com> writes:\n\n> Trying really trivial in-index merge...\n> Documentation/user/advanced-notation.itely: needs merge\n> fatal: you need to resolve your current index first\n\nYou got from a \"git pull\", which means you were already in\nanother merge (perhaps failed).  That is a no-no.\n\nThe error messages need to be cleaned up and be more helpful.\nThere is no question about it.\n\n> Nope.\n> Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2\n> Merging:\n> 038b7fc Misc small updates (trying to make git work).\n> c21d3f3 Merge branch 'master' of\n> ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond\n> found 1 common ancestor(s):\n> 84219bb don't have input/templates/ any longer.\n> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\n> No merge strategy handled the merge.\n\nSo the question is what you did _before_ initiating this \"git pull\".\n\nFor new people, we recommend to:\n\n * make sure you were on a right branch (I think you are.  You\n   are on your 'master' branch and may not even have any other\n   branches, which is fine.)\n\n * make sure all your changes are committed.\n\nbefore initiating a \"git pull\".  And after a conflicted \"git\npull\", if you choose to punt,\n\n\t$ git reset --hard\n\nwould take you back to the state before you started the pull.\n\n> SUGGESTIONS\n>\n> The \"tutorial introduction to git\" looks like a nice document, but it\n> assumes that you are in control of the project.  For users who aren't in\n> control (ie me) this is a problem, because it starts me skimming.\n> \"Importing a project\"... nah, that's not me.  \"Merging branches\"... I\n> don't care; I'm going to shove everything into the main branch.  \"Using\n> git for collaboration\"... hmm, maybe this is the stuff I need to read.\n> But by this point, I've already skimmed through five screens of info, so\n> I'm not reading very carefully.\n\nYes, git caters to too many classes of people.\n\nI've heard people talk about \"everyday\" document as a good\ntable-of-contents, primarily because it first breaks down the\nuserbase into roles and talks about common commands for each\nrole of the user.  I am not in the position to judge the quality\nof the document, though.\n"},{"id":"296458","messageId":"20061206015209.GD12211@socrates.priv","threadId":"43135","inReplyTo":"457611B9.9020907@gmail.com","subject":"Re: git newbie problems","fromName":"Tom Prince","fromEmail":"tom.prince@ualberta.net","sentAt":"2006-12-06T01:52:09Z","receivedAt":"2006-12-06T01:52:09Z","isPatch":false,"sender":{"key":"tom.prince@ualberta.net","avatar":"https://gravatar.com/avatar/a0ad19caee7618876339485106ec994f5202505eecd210ba5c0bd869feaa555a?d=mp&s=160"},"body":"On Tue, Dec 05, 2006 at 04:41:29PM -0800, Graham Percival wrote:\n> Greetings,\n> \n> I'm posting these problems at Han-Wen and Dscho's insistence.  I'm the \n> documentation editor for GNU/LilyPond, so I'm reluctant to criticize \n> other project's documentation unless I spend an hour or more seriously \n> reading it.\n\nIt is generally accepted that much of git documentation sucks in various ways,\nand people have stepped up to help fix this. The problem is that most\npeople are already well-versed in git, which makes it harder to identify\nthe problem areas in the documentation, and that few people unfamiliar\nwith git post to report their problems with the documentation, or UI so\nthat, at least on the mailinglist itself, we get little direct feedback on the\ndocumentation or UI.\n\nThank you from the list for your contribution.\n\n"},{"id":"297547","messageId":"457678BD.3050609@gmail.com","threadId":"43135","inReplyTo":"el5608$952$2@sea.gmane.org","subject":"Re: git newbie problems","fromName":"Graham Percival","fromEmail":"gpermus@gmail.com","sentAt":"2006-12-06T08:01:01Z","receivedAt":"2006-12-06T08:01:01Z","isPatch":false,"sender":{"key":"gpermus@gmail.com","avatar":null},"body":"Jakub Narebski wrote:\n> Graham Percival wrote:\n> \n>> flailed around looking for magic commands to make things work.  By \"make \n>> things work\", I mean imitating my work style with cvs:\n> \n> Perhaps it would be better to at least read cvs-migration.txt\n>   http://kernel.org/pub/software/scm/git/docs/cvs-migration.html\n> and all tutorials.\n\nI skimmed through the cvs-migration, the tutorial (part 1 and 2), and \nthe \"everyday git\".  I didn't notice any \"how to deal with merges \nproblems\"... it was unfortunate that the merge problems arose the very \nfirst time I tried to upload my changes.  If I had used git for a few \ndays before it happened, I would have had more confidence to track down \nthe problem (or email for help earlier!).\n\n> There are some commands which CVS didn't have, and which are very useful\n> with git: I'm talking here about \"git show\" (show latest change), \"git\n> log\" (show kind of changelog), and gitk (graphical history viewer) or qgit\n> (alternate graphical history viewer in Qt).\n\nYes, I don't doubt that git has many improvements -- the main developers \nof my project must have had some reason for moving away from cvs!  I'm \nspeaking as a new user who wants to get very simple work done.  All I \nwanted to do was to fix a few typos in the lilypond documentation; the \ninformation about importing cvs projects or changing branches obscured \nthe stuff I really wanted.\n\n\n> Yes, the git error messages certainly needs to be made more user-friendly.\n> What git says here that one version has '.gitignore' file handled by version\n> control, and second has it outside version control. At least I think what\n> it does. \"git ls-files --unmerged\" or \"git diff --merge --summary\" should\n> show 'true conflicts'.\n\nThanks for the suggestions!\n\n> By the way, which version of git do you use? I think this particular check\n> (if it is the case of this error) was relaxed.\n\ngit version 1.4.4.1\nI installed it via fink/unstable on OSX.\n\nCheers,\n"},{"id":"298115","messageId":"45768FE8.2030202@xs4all.nl","threadId":"43135","inReplyTo":"el55to$952$1@sea.gmane.org","subject":"Re: git newbie problems","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-12-06T09:39:52Z","receivedAt":"2006-12-06T09:39:52Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"\nJakub Narebski escreveu:\n>> 84219bb don't have input/templates/ any longer.\n>> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\n>> No merge strategy handled the merge.\n>>\n>> As a git newbie, I'm quite confused.  OK, there's no merge strategy...\n>> so what do I do now?  With cvs, the changes would be dumped into the\n>> file.  I look at the file, found the conflict, and tried it again.  I\n>> got the same error message, and then it occurred to me that although I\n>> changed the files in my ~/usr/src/lilypond, git might be storing these\n>> files somewhere else.\n> \n> Yes, the git error messages certainly needs to be made more user-friendly.\n> What git says here that one version has '.gitignore' file handled by version\n> control, and second has it outside version control. At least I think what\n> it does.\n\nWhich is actually not true. .gitignore has been in the repo since we\nstarted using git.  I have also seen this message pop up a few times\nin the beginning, but I can't recall why they happened.\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"297591","messageId":"4576937D.1070402@xs4all.nl","threadId":"43135","inReplyTo":"Pine.LNX.4.63.0612060157020.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: git patch","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-12-06T09:55:09Z","receivedAt":"2006-12-06T09:55:09Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Johannes Schindelin escreveu:\n> The nice thing for me about Git: you never lose anything. Unless you say \n> \"git prune\" (in which case you really should know what you are doing), you \n> do not lose (committed) data.\n> \n> Now, I promised to tell you what to do if all the files seem modified. Did \n> you look through \"git -p diff\"? (BTW with recent Git you only need \"git \n> diff\" and it will pipe the result into your pager automatically.)\n\nThis actually bothers me as well from a UI point of view.  Git-diff is\nused both for generating diffs between versions that come from git and\nthe working tree/index.\n\nI think it would be more logical to show those diffs as part of\ngit-status and perhaps git-commit, eg.\n\n  git-commit --dry-run <commitoptions>\n\nshows the diff of what would be committed\n\n  git-status --diff\n\nshows diffs of modified files in the working tree.\n\nThis makes it more clear what each diff means.\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"298527","messageId":"7vslft738m.fsf@assigned-by-dhcp.cox.net","threadId":"43135","inReplyTo":"4576937D.1070402@xs4all.nl","subject":"Re: git patch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-06T10:00:57Z","receivedAt":"2006-12-06T10:00:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Han-Wen Nienhuys <hanwen@xs4all.nl> writes:\n\n> I think it would be more logical to show those diffs as part of\n> git-status and perhaps git-commit, eg.\n>\n>   git-commit --dry-run <commitoptions>\n>\n> shows the diff of what would be committed\n>\n>   git-status --diff\n>\n> shows diffs of modified files in the working tree.\n>\n> This makes it more clear what each diff means.\n\nJust in case people did not know, \"git status\" is pronounced as\n\"git commit --dry-run\".\n\nIt takes exactly the same set of parameters as \"git commit\", and\nshows what would have been in the commit log message editor as\nthe status comments.\n\nAnd it even takes the \"-v\" option that \"git commit\" takes.\n\n"},{"id":"297754","messageId":"200612061117.32903.jnareb@gmail.com","threadId":"43135","inReplyTo":"45768FE8.2030202@xs4all.nl","subject":"Re: git newbie problems","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-06T10:17:31Z","receivedAt":"2006-12-06T10:17:31Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Han-Wen Nienhuys wrote:\n \n> Jakub Narebski escreveu:\n>\n>> Graham Percival wrote:\n>>\n>>> 84219bb don't have input/templates/ any longer.\n>>> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.\n>>> No merge strategy handled the merge.\n>>>\n>>> As a git newbie, I'm quite confused.  OK, there's no merge strategy...\n\nThere is no merge strategy used, because problem (conflict) doesn't stem\nfrom what was committed, but from what was in working directory.\n\n>>> so what do I do now?  With cvs, the changes would be dumped into the\n>>> file.  I look at the file, found the conflict, and tried it again.  I\n>>> got the same error message, and then it occurred to me that although I\n>>> changed the files in my ~/usr/src/lilypond, git might be storing these\n>>> files somewhere else.\n>> \n>> Yes, the git error messages certainly needs to be made more user-friendly.\n>> What git says here that one version has '.gitignore' file handled by version\n>> control, and second has it outside version control. At least I think what\n>> it does.\n> \n> Which is actually not true. .gitignore has been in the repo since we\n> started using git.  I have also seen this message pop up a few times\n> in the beginning, but I can't recall why they happened.\n\nI don't know if git allows to pull into dirty tree with impunity. If I\nremeber correctly Cogito (alternate UI for git) allows this[*1*], there is\ncurrently work on this in git (but it is not as far as I remember in\ngit 1.4.4.1). So another possibility is induced by CVS \"update then commit\"\nmentality pulling changes _before_ commiting changes.\n\nIf this is the case, committing changes _then_ pulling would solve this\nproblem.\n\nFootnotes:\n----------\n[*1*] This is a bit error prone.\n-- \nJakub Narebski\n"},{"id":"297008","messageId":"457699C1.3060400@xs4all.nl","threadId":"43135","inReplyTo":"200612061117.32903.jnareb@gmail.com","subject":"Re: git newbie problems","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-12-06T10:21:53Z","receivedAt":"2006-12-06T10:21:53Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Jakub Narebski escreveu:\n\n> I don't know if git allows to pull into dirty tree with impunity. If I\n> remeber correctly Cogito (alternate UI for git) allows this[*1*], there is\n> currently work on this in git (but it is not as far as I remember in\n> git 1.4.4.1). So another possibility is induced by CVS \"update then commit\"\n> mentality pulling changes _before_ commiting changes.\n\nit is quite possibly a side-effect of cvs-habits. Note that in the beginning\nI have wrestled to make git update the HEAD , eg. trying --update-head-ok\n\n-- \n"},{"id":"296047","messageId":"el65h9$tfj$2@sea.gmane.org","threadId":"43135","inReplyTo":"4576937D.1070402@xs4all.nl","subject":"Re: git patch","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-06T10:22:32Z","receivedAt":"2006-12-06T10:22:32Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Han-Wen Nienhuys wrote:\n\n> I think it would be more logical to show those diffs as part of\n> git-status and perhaps git-commit, eg.\n> \n>   git-commit --dry-run <commitoptions>\n> \n> shows the diff of what would be committed\n> \n>   git-status --diff\n> \n> shows diffs of modified files in the working tree.\n> \n> This makes it more clear what each diff means.\n\nI'd rather say\n\n  git-commit --diff\n\nor\n\n  git-diff --commit\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"295285","messageId":"Pine.LNX.4.63.0612061140540.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43135","inReplyTo":"457699C1.3060400@xs4all.nl","subject":"Re: git newbie problems","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-06T10:42:29Z","receivedAt":"2006-12-06T10:42:29Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Dec 2006, Han-Wen Nienhuys wrote:\n\n> Note that in the beginning I have wrestled to make git update the HEAD , \n> eg. trying --update-head-ok\n\nAh! That would explain many of the problems! BTW where did you see that \noption mentioned? We should hide this option as deep in the technical \nlores of the documentation, fast.\n\nCiao,\nDscho\n"},{"id":"297134","messageId":"4576A916.7090801__8302.57246639139$1165404468$gmane$org@xs4all.nl","threadId":"43135","inReplyTo":"Pine.LNX.4.63.0612061147540.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: git patch","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-12-06T11:27:18Z","receivedAt":"2006-12-06T11:27:18Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Johannes Schindelin escreveu:\n>> shows the diff of the change that he just introduced\n> \n> Okay. But you mean\n> \n> $ git commit --dry file1 file2...\n> \n> or\n> \n> $ git commit --dry -a\n\n\nWell, --dry would be usable both with -a and file1, file2.\n\nI agree with Jakub that --diff might be a better name, but it should \nbe part of git-commit command, rather than the git-diff.\n\n> Or, you use the script git-hunk-commit.bash which I posted. Which reminds \n> me: I wanted to rewrite it for you so it is more non-brand-new-bash \n> friendly.\n\n:)\n\nthat's really nice, but actually recording separate hunks is a bit of\na headache if you have to do it over the command line. Under darcs, I\nalways use darcsum in emacs. In git, I always use git-status.\n  \n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"295152","messageId":"Pine.LNX.4.63.0612061325320.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43135","inReplyTo":"20061206.105251.144349770.wl@gnu.org","subject":"[PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-06T12:27:40Z","receivedAt":"2006-12-06T12:27:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nIt really is an important concept to grasp for people coming\nfrom CVS. Even if it is briefly mentioned, it is not obvious\nenough to sink in.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n\n\tOn Wed, 6 Dec 2006, Werner LEMBERG wrote:\n\t\n\t> It took me a while to realize that a git repository, as soon as \n\t> you've cloned it, is *self-contained*, and that commiting to the \n\t> repository and synchronizing with a different git repository are \n\t> two completely different things (contrary to CVS).  This should \n\t> be pronounced more in the CVS->git guide.\n\n Documentation/cvs-migration.txt |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\nindex 6812683..8e610c7 100644\n--- a/Documentation/cvs-migration.txt\n+++ b/Documentation/cvs-migration.txt\n@@ -24,6 +24,11 @@ First, note some ways that git differs from CVS:\n     single shared repository which people can synchronize with; see below\n     for details.\n \n+  * Since every working tree contains a repository, a commit will not\n+    publish your changes; it will only create a revision. You have to\n+    \"push\" your changes to a public repository to make them visible\n+    to others.\n+\n Importing a CVS archive\n -----------------------\n \n-- \n"},{"id":"295124","messageId":"el6d50$p7e$2@sea.gmane.org","threadId":"43135","inReplyTo":"Pine.LNX.4.63.0612061325320.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-06T12:32:32Z","receivedAt":"2006-12-06T12:32:32Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Johannes Schindelin wrote:\n\n> +  * Since every working tree contains a repository, a commit will not\n> +    publish your changes; it will only create a revision. You have to\n> +    \"push\" your changes to a public repository to make them visible\n> +    to others.\n> +\n\nI'm not sure about context of this addition, but it is simply not\ntrue if you publish your working repository. Granted, usually one\nsets up bare public publishing repository...\n\nBy publish I mean set up http(s):// or git://, or ssh+git://, or local\ntransport.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"297474","messageId":"Pine.LNX.4.63.0612061411380.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43135","inReplyTo":"el6d50$p7e$2@sea.gmane.org","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-06T13:14:16Z","receivedAt":"2006-12-06T13:14:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Dec 2006, Jakub Narebski wrote:\n\n> Johannes Schindelin wrote:\n> \n> > +  * Since every working tree contains a repository, a commit will not\n> > +    publish your changes; it will only create a revision. You have to\n> > +    \"push\" your changes to a public repository to make them visible\n> > +    to others.\n> > +\n> \n> I'm not sure about context of this addition, but it is simply not\n> true if you publish your working repository.\n\nRemember, you are talking to CVS users. They are not dumb, but sooo used \nto the CVS ways. So, they do not publish their working directory.\n\nLater, when they became familiar with Git, you can tell them: \"BTW you can \nalso publish your working directory, but then you have to be extra careful \nwith git-commit --amend, and if you allow pushing into your repo you have \nto add hooks to prevent updating your current HEAD, etc.\"\n\nGive them a chance to get used to the concepts of Git.\n\nCiao,\nDscho\n"},{"id":"298681","messageId":"200612061427.58065.jnareb@gmail.com","threadId":"43135","inReplyTo":"Pine.LNX.4.63.0612061411380.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-06T13:27:57Z","receivedAt":"2006-12-06T13:27:57Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Hi!\n\nJohannes Schindelin wrote:\n\n> On Wed, 6 Dec 2006, Jakub Narebski wrote:\n> \n>> Johannes Schindelin wrote:\n>> \n>>> +  * Since every working tree contains a repository, a commit will not\n>>> +    publish your changes; it will only create a revision. You have to\n>>> +    \"push\" your changes to a public repository to make them visible\n>>> +    to others.\n>>> +\n\nI'd perhaps add here that it doesn't \"push\" your changes to a repository\nyou cloned from / you fetch from.\n \n>> I'm not sure about context of this addition, but it is simply not\n>> true if you publish your working repository.\n> \n> Remember, you are talking to CVS users. They are not dumb, but sooo used \n> to the CVS ways. So, they do not publish their working directory.\n\nSo we are talking in context of having CVS-like one central repository\nfrom which they pull / fetch, and to which they push?\n \n> Later, when they became familiar with Git, you can tell them: \"BTW you can \n> also publish your working directory, but then you have to be extra careful \n> with git-commit --amend, and if you allow pushing into your repo you have \n> to add hooks to prevent updating your current HEAD, etc.\"\n\nI'd rather say that \"publish your working repository\", not \"working\ndirectory\" here.\n\n> Give them a chance to get used to the concepts of Git.\n\nWell, it would be best to teach them concepts of git along.\n\n-- \nJakub Narebski\n"},{"id":"295796","messageId":"Pine.LNX.4.63.0612061430320.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43135","inReplyTo":"200612061427.58065.jnareb@gmail.com","subject":"New users, was Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-06T13:32:42Z","receivedAt":"2006-12-06T13:32:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Dec 2006, Jakub Narebski wrote:\n\n> Johannes Schindelin wrote:\n> \n> > Give them a chance to get used to the concepts of Git.\n> \n> Well, it would be best to teach them concepts of git along.\n\nNOOOOO!\n\nIt might surprise you that most users are not at all interested in how Git \nworks. They just want to use the thing. And we should not try to make life \nhard on them. Teach them what they have to know _as quickly as possible_ \nso that they can continue to work. They'll come back for more.\n\nIf you make it as complicated as Malbolge to them, you will never know you \nlost a happy camper, because they _will not tell you_!\n\nCiao,\nDscho\n"},{"id":"293899","messageId":"20061206145219.GB1714@fieldses.org","threadId":"43135","inReplyTo":"el6d50$p7e$2@sea.gmane.org","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-06T14:52:19Z","receivedAt":"2006-12-06T14:52:19Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Wed, Dec 06, 2006 at 01:32:32PM +0100, Jakub Narebski wrote:\n> Johannes Schindelin wrote:\n> \n> > +  * Since every working tree contains a repository, a commit will not\n> > +    publish your changes; it will only create a revision. You have to\n> > +    \"push\" your changes to a public repository to make them visible\n> > +    to others.\n> > +\n> \n> I'm not sure about context of this addition, but it is simply not\n> true if you publish your working repository. Granted, usually one\n> sets up bare public publishing repository...\n\nThat's true, but this document is focused on the cvs-like case of\nmultiple private repos pushing to a single common public repo.\n\nBut we could replace \"a commit will not publish\" by \"a commit in your\nprivate repository will not publish\"--which would make the statement\ntrue without distracting from the main point.\n\n"},{"id":"296919","messageId":"4576D92A.80307@xs4all.nl","threadId":"43135","inReplyTo":"Pine.LNX.4.63.0612061325320.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-12-06T14:52:26Z","receivedAt":"2006-12-06T14:52:26Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Johannes Schindelin escreveu:\n> It really is an important concept to grasp for people coming\n> from CVS. Even if it is briefly mentioned, it is not obvious\n> enough to sink in.\n\nI think the goal is laudable, but IMO it would be better to shorten\nthe document rather adding more text.\n\nhere is my try\n \nFrom 980a0ca1b274e1219c24c3138f95e42206c72875 Mon Sep 17 00:00:00 2001\nFrom: Han-Wen Nienhuys <hanwen@lilypond.org>\nDate: Wed, 6 Dec 2006 15:50:13 +0100\nSubject: [PATCH] another try at  rephrasing cvs doc.\n\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>\n---\n Documentation/cvs-migration.txt |   34 +++++++++++++++++++++++-----------\n 1 files changed, 23 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\nindex 6812683..3270c57 100644\n--- a/Documentation/cvs-migration.txt\n+++ b/Documentation/cvs-migration.txt\n@@ -6,24 +6,36 @@ this document is to put you on the road to recovery, by helping you\n convert an existing cvs repository to git, and by showing you how to use a\n git repository in a cvs-like fashion.\n \n-Some basic familiarity with git is required.  This\n-link:tutorial.html[tutorial introduction to git] should be sufficient.\n-\n-First, note some ways that git differs from CVS:\n+Git differs from CVS:\n \n   * Commits are atomic and project-wide, not per-file as in CVS.\n \n-  * Offline work is supported: you can make multiple commits locally,\n+  * Branching is fast and easy.\n+\n+  * GIT is a distributed version control system:\n+    This has several consequences:\n+\n+    - Every working tree contains a repository with a full copy of the\n+    project history.\n+    \n+    - Offline work is supported: you can create revisions locally,\n     then submit them when you're ready.\n \n-  * Branching is fast and easy.\n+    Hence, there is a difference between creating a revision\n+    (the \"commit\" command) and submitting it (the \"push\" command).\n+\n+    - No repository is inherently more important than\n+    any other.\n+    \n+    Of course, a project may still designate one central repository as\n+    the True Master that contributors synchronize with.\n+\n+    See below for details.\n \n-  * Every working tree contains a repository with a full copy of the\n-    project history, and no repository is inherently more important than\n-    any other.  However, you can emulate the CVS model by designating a\n-    single shared repository which people can synchronize with; see below\n-    for details.\n+Some basic familiarity with git is required.  This\n+link:tutorial.html[tutorial introduction to git] should be sufficient.\n \n+    \n Importing a CVS archive\n -----------------------\n \n-- \n1.4.4.1.gc9922-dirty\n\n\n-- \n"},{"id":"294810","messageId":"20061206145802.GC1714@fieldses.org","threadId":"43135","inReplyTo":"4576D92A.80307@xs4all.nl","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-06T14:58:02Z","receivedAt":"2006-12-06T14:58:02Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Wed, Dec 06, 2006 at 03:52:26PM +0100, Han-Wen Nienhuys wrote:\n> Johannes Schindelin escreveu:\n> > It really is an important concept to grasp for people coming\n> > from CVS. Even if it is briefly mentioned, it is not obvious\n> > enough to sink in.\n> \n> I think the goal is laudable, but IMO it would be better to shorten\n> the document rather adding more text.\n\nOK, but...\n\n>  Documentation/cvs-migration.txt |   34 +++++++++++++++++++++++-----------\n>  1 files changed, 23 insertions(+), 11 deletions(-)\n\n... that lengthens it even more than the proposed addition.\n\n> +    Hence, there is a difference between creating a revision\n> +    (the \"commit\" command) and submitting it (the \"push\" command).\n\nI'd rather leave that introduction as it is--just as a section that\nadvertises the git features without trying to explain much.  And I'd\nrather not mention push until we have a chance to explain how to use it.\n\n"},{"id":"297026","messageId":"4576DC48.1060201@xs4all.nl","threadId":"43135","inReplyTo":"20061206145802.GC1714@fieldses.org","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-12-06T15:05:44Z","receivedAt":"2006-12-06T15:05:44Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"J. Bruce Fields escreveu:\n> On Wed, Dec 06, 2006 at 03:52:26PM +0100, Han-Wen Nienhuys wrote:\n>> Johannes Schindelin escreveu:\n>>> It really is an important concept to grasp for people coming\n>>> from CVS. Even if it is briefly mentioned, it is not obvious\n>>> enough to sink in.\n>> I think the goal is laudable, but IMO it would be better to shorten\n>> the document rather adding more text.\n> \n> OK, but...\n> \n>>  Documentation/cvs-migration.txt |   34 +++++++++++++++++++++++-----------\n>>  1 files changed, 23 insertions(+), 11 deletions(-)\n> \n> ... that lengthens it even more than the proposed addition.\n\nYes, but with white space.\n\n> I'd rather leave that introduction as it is--just as a section that\n> advertises the git features without trying to explain much.  And I'd\n> rather not mention push until we have a chance to explain how to use it.\n\nAs was mentioned in another thread, it make more sense to split this file up \ninto separate documents for project contributors and project admins.\n\n-- \n"},{"id":"295211","messageId":"Pine.LNX.4.63.0612061613460.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43135","inReplyTo":"20061206145802.GC1714@fieldses.org","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-06T15:16:57Z","receivedAt":"2006-12-06T15:16:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Dec 2006, J. Bruce Fields wrote:\n\n> I'd rather leave that introduction as it is--just as a section that \n> advertises the git features without trying to explain much.  And I'd \n> rather not mention push until we have a chance to explain how to use it.\n\nYou talk like you'd have an eternity to explain Git. But that is not true. \nA developer, especially those whom Git is forced upon, have an attention \nspan shorter than their pub1c hair.\n\nI _know_ that _I_ did not read the whole document about \"Branching and \nmerging in Git\".\n\nCiao,\nDscho\n"},{"id":"297432","messageId":"20061206171950.GD1714@fieldses.org","threadId":"43135","inReplyTo":"Pine.LNX.4.63.0612061613460.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-06T17:19:50Z","receivedAt":"2006-12-06T17:19:50Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Wed, Dec 06, 2006 at 04:16:57PM +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Wed, 6 Dec 2006, J. Bruce Fields wrote:\n> \n> > I'd rather leave that introduction as it is--just as a section that \n> > advertises the git features without trying to explain much.  And I'd \n> > rather not mention push until we have a chance to explain how to use it.\n> \n> You talk like you'd have an eternity to explain Git. But that is not true.\n> A developer, especially those whom Git is forced upon, have an attention \n> span shorter than their pub1c hair.\n\nDefinitely, I agree.  So that argues for locating the most import stuff\nas close to start of the document as possible.  But obviously there's\nlot of important stuff and you can't do that with everything, so you\nalso have to rely on keeping things organized so people can more easily\nskip to the middle.\n\nThe rest of the introduction is all git marketing: why you should like\nusing git instead of cvs.  So someone skimming for the quickest possible\n\"how do I make changes?\" stuff may skip it entirely.\n\nThe thing that might help such a skimmer the most, actually, would be\na more helpful title for the section that actually does have what\nthey're looking for.  And making sure that particular section has the\nright stuff.  How about something like this?\n\n--b.\n\ncvs-migration: improved section titles, better push/commit explanation\n\nRename the section titles to make the \"how-to\" content of the section\nobvious.  Also clarify that changes have to be commited before they can\nbe pushed.\n\n---\n\n cvs-migration.txt |   19 ++++++++++++-------\n 1 file changed, 12 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\nindex 6812683..726b48d 100644\n--- a/Documentation/cvs-migration.txt\n+++ b/Documentation/cvs-migration.txt\n@@ -76,8 +76,8 @@ variants of this model.\n With a small group, developers may just pull changes from each other's\n repositories without the need for a central maintainer.\n \n-Emulating the CVS Development Model\n------------------------------------\n+Creating a Shared Repository\n+----------------------------\n \n Start with an ordinary git working directory containing the project, and\n remove the checked-out files, keeping just the bare .git directory:\n@@ -105,7 +105,10 @@ $ GIT_DIR=repo.git git repo-config core.\n Make sure committers have a umask of at most 027, so that the directories\n they create are writable and searchable by other group members.\n \n-Suppose this repository is now set up in /pub/repo.git on the host\n+Performing Development on a Shared Repository\n+---------------------------------------------\n+\n+Suppose a repository is now set up in /pub/repo.git on the host\n foo.com.  Then as an individual committer you can clone the shared\n repository:\n \n@@ -134,15 +137,17 @@ Pull: master:origin\n ------------\n ================================\n \n-You can update the shared repository with your changes using:\n+You can update the shared repository with your changes by first commiting\n+your changes, and then using:\n \n ------------------------------------------------\n $ git push origin master\n ------------------------------------------------\n \n-If someone else has updated the repository more recently, `git push`, like\n-`cvs commit`, will complain, in which case you must pull any changes\n-before attempting the push again.\n+to \"push\" those commits to the shared repository.  If someone else has\n+updated the repository more recently, `git push`, like `cvs commit`, will\n+complain, in which case you must pull any changes before attempting the\n+push again.\n \n In the `git push` command above we specify the name of the remote branch\n"},{"id":"295397","messageId":"20061206172450.GE1714@fieldses.org","threadId":"43135","inReplyTo":"20061206171950.GD1714@fieldses.org","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-06T17:24:50Z","receivedAt":"2006-12-06T17:24:50Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Wed, Dec 06, 2006 at 12:19:50PM -0500, J. Bruce Fields wrote:\n> On Wed, Dec 06, 2006 at 04:16:57PM +0100, Johannes Schindelin wrote:\n> Definitely, I agree.  So that argues for locating the most import stuff\n> as close to start of the document as possible.  But obviously there's\n> lot of important stuff and you can't do that with everything, so you\n> also have to rely on keeping things organized so people can more easily\n> skip to the middle.\n\nHm, but, come to think of it, I agree with you that the \"how to commit\nand push\" really should come earlier, since that's the stuff most people\nneed to know; currently the order is roughly:\n\n\timporting a cvs archive\n\tcreating a shared repository\n\tcommitting to a shared repository\n\nWe should start out with the assumption that a shared repo is already\nset up and make it:\n\n\tcommitting to a shared repository\n\tcreating a shared repository\n\timporting a cvs archive\n\nwhich puts it in stuff-most-people-need-to-know to\nstuff-less-people-need-to-know order.  Maybe the current introduction\nshould even be postponed to later.\n\nAnd some day we should move that whole final CVS annotate section\nelsewhere.\n\n"},{"id":"294992","messageId":"7v7ix47wbr.fsf@assigned-by-dhcp.cox.net","threadId":"43135","inReplyTo":"20061206172450.GE1714@fieldses.org","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-06T17:44:56Z","receivedAt":"2006-12-06T17:44:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J. Bruce Fields\" <bfields@fieldses.org> writes:\n\n> And some day we should move that whole final CVS annotate section\n> elsewhere.\n\nI agree that we should make that particular document shorter by\ncatering the immediate need of CVS migrant.  No need for git\nmarketting and showing off the power.\n\nIn that spirit, I think we can lose the section on 'annotate'\naltogether now.  It was written in June 2005, way before\n'annotate' and 'blame', both of which came in Feb 2006.\n\n"},{"id":"297678","messageId":"45773002.5020409@gmail.com","threadId":"43135","inReplyTo":"20061206172450.GE1714@fieldses.org","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"Graham Percival","fromEmail":"gpermus@gmail.com","sentAt":"2006-12-06T21:02:58Z","receivedAt":"2006-12-06T21:02:58Z","isPatch":true,"sender":{"key":"gpermus@gmail.com","avatar":null},"body":"J. Bruce Fields wrote:\n> We should start out with the assumption that a shared repo is already\n> set up and make it:\n> \n> \tcommitting to a shared repository\n> \tcreating a shared repository\n> \timporting a cvs archive\n> \n> which puts it in stuff-most-people-need-to-know to\n> stuff-less-people-need-to-know order.  Maybe the current introduction\n> should even be postponed to later.\n\nYes, definitely!\n\nI'm not complaining about changing to git, but Dscho's comment really \nrings true:\n\n > A developer, especially those whom Git is forced upon, have an\n > attention span shorter than their pub1c hair.\n\nI'm in the middle of exam period, I have a term papers to write, and I \nhave two weeks of lilypond bug reports and doc typos to process.  I \ndon't care if git can do branches really nicely or walk my dog or cure \ncancer.  I can look at that stuff later -- right now I just want to fix \nthings and upload them.\n\nCheers,\n"},{"id":"297773","messageId":"20061206214546.GB25465@fieldses.org","threadId":"43135","inReplyTo":"45773002.5020409@gmail.com","subject":"Re: [PATCH] cvs-migration document: make the need for \"push\" more obvious","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-06T21:45:46Z","receivedAt":"2006-12-06T21:45:46Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Wed, Dec 06, 2006 at 01:02:58PM -0800, Graham Percival wrote:\n> I'm in the middle of exam period, I have a term papers to write, and I \n> have two weeks of lilypond bug reports and doc typos to process.  I \n> don't care if git can do branches really nicely or walk my dog or cure \n> cancer.  I can look at that stuff later -- right now I just want to fix \n> things and upload them.\n\nYeah.  It's a tricky problem; different people need different things,\nand to cover everything (and explain it correctly) the documentation\nneeds to be long; but to ensure that impatient people can get to what\nthey need quickly, there needs to be a short, clear path to their\nparticular need.\n\nA few down-to-earth approaches that could help:\n\n\t- Clearer section/chapter titles, so we can generate tables of\n\t  contents where people can quickly find stuff--so, titles that\n\t  explain what the section will show you how to do with\n\t  minimized use of jargon that the user doesn't know yet (\"how\n\t  to keep a repository up-to-date\" as opposed to \"git-fetch and\n\t  remotes\").\n\n\t- As in \"Everyday Git\", think about what different groups of\n\t  users need.  But where possible, try to order documentation\n\t  with the stuff needed by the largest group of people first.\n\t  (For example, right now all the tutorials start with \"git\n\t  init-db\" and \"git commit\", assuming people are starting a\n\t  project from scratch, when the more typical usage is probably\n\t  someone joining an existing project, and possibly doing only\n\t  read-only stuff at first.)\n\n\t- Clearer ordering and dependencies, so when people find the \"how\n\t  to resolve merges\" section, they can quickly see what else\n\t  they'd need to read before that.  (And, yeah, I realize 99% of\n\t  the time they won't actually do that--they'll just dive right\n\t  in and try a few examples.  But at least they'll know where to\n\t  turn if that gets them in trouble....)\n\n"},{"id":"295026","messageId":"Pine.LNX.4.64.0612061637130.20138@iabervon.org","threadId":"43135","inReplyTo":"7v4ps9byca.fsf@assigned-by-dhcp.cox.net","subject":"Re: git newbie problems","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2006-12-06T22:19:28Z","receivedAt":"2006-12-06T22:19:28Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 5 Dec 2006, Junio C Hamano wrote:\n\n> For new people, we recommend to:\n> \n>  * make sure you were on a right branch (I think you are.  You\n>    are on your 'master' branch and may not even have any other\n>    branches, which is fine.)\n> \n>  * make sure all your changes are committed.\n> \n> before initiating a \"git pull\".  And after a conflicted \"git\n> pull\", if you choose to punt,\n> \n> \t$ git reset --hard\n> \n> would take you back to the state before you started the pull.\n\nIf there are uncommitted changes, and there are conflicts, shouldn't it \nleave you in the state before the pull, especially if the uncommitted \nchanges conflict with the merge? Git has determined that it can't present \nall of the conflicts to the user, so the user can't possibly resolve all \nof the conflicts, except by discarding new work or pushing it into the \nmerge inappropriately. \n\nI think that a lot of new users will pull with uncommitted changes, and \nthey'd benefit from just being told that you're supposed to commit first \nand then merge. It should definitely roll back perfectly to the state \nbefore the pull if it wasn't able to present all the conflicts, since even \nsomebody who knows what's going on is going to have to roll back here.\n\nPossibly there should even be an option (defaulting to true) which \ncompletely blocks \"pull\" with uncommitted changes. Even if the in-index \nmerge works (and the working directory is entirely unneeded), it's pretty \nlikely that the user would do better to be in the habit of doing it in the \nother order anyway.\n\n\t-Daniel\n"},{"id":"297735","messageId":"20061207041805.GC3457@fieldses.org","threadId":"43135","inReplyTo":"7v7ix47wbr.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Documentation: reorganize cvs-migration.txt","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-07T04:18:05Z","receivedAt":"2006-12-07T04:18:05Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"Modify cvs-migration.txt so it explains first how to develop against a\nshared repository, then how to set up a shared repository, then how to\nimport a repository from cvs.  Though this seems chronologically\nbackwards, it's still readable in this order, and it puts the more\ncommonly needed material closer to the front.\n\nRemove the annotate/pickaxe section; perhaps it can find a place elsewhere\nin the future.  Remove most of the \"why git is better than cvs\" stuff from\nthe introduction.\n\nAdd some minor clarifications, including two that have come up several\ntimes on the mailing list:\n\n\t1. Recommend committing any changes before running pull.\n\t2. Note that changes must be commited before they can be pushed.\n\nUpdate the clone discussion to reflect the new --use-separate-remotes\ndefault, and add a brief mention of git-cvsserver.\n\nSigned-off-by: J. Bruce Fields <bfields@citi.umich.edu>\n---\n Documentation/cvs-migration.txt |  349 ++++++++++++---------------------------\n 1 files changed, 109 insertions(+), 240 deletions(-)\n\ndiff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\nindex 6812683..773fc99 100644\n--- a/Documentation/cvs-migration.txt\n+++ b/Documentation/cvs-migration.txt\n@@ -1,113 +1,21 @@\n git for CVS users\n =================\n \n-So you're a CVS user. That's OK, it's a treatable condition.  The job of\n-this document is to put you on the road to recovery, by helping you\n-convert an existing cvs repository to git, and by showing you how to use a\n-git repository in a cvs-like fashion.\n+Git differs from CVS in that every working tree contains a repository with\n+a full copy of the project history, and no repository is inherently more\n+important than any other.  However, you can emulate the CVS model by\n+designating a single shared repository which people can synchronize with;\n+this document explains how to do that.\n \n Some basic familiarity with git is required.  This\n link:tutorial.html[tutorial introduction to git] should be sufficient.\n \n-First, note some ways that git differs from CVS:\n-\n-  * Commits are atomic and project-wide, not per-file as in CVS.\n-\n-  * Offline work is supported: you can make multiple commits locally,\n-    then submit them when you're ready.\n-\n-  * Branching is fast and easy.\n-\n-  * Every working tree contains a repository with a full copy of the\n-    project history, and no repository is inherently more important than\n-    any other.  However, you can emulate the CVS model by designating a\n-    single shared repository which people can synchronize with; see below\n-    for details.\n-\n-Importing a CVS archive\n------------------------\n-\n-First, install version 2.1 or higher of cvsps from\n-link:http://www.cobite.com/cvsps/[http://www.cobite.com/cvsps/] and make\n-sure it is in your path.  The magic command line is then\n-\n--------------------------------------------\n-$ git cvsimport -v -d <cvsroot> -C <destination> <module>\n--------------------------------------------\n-\n-This puts a git archive of the named CVS module in the directory\n-<destination>, which will be created if necessary.  The -v option makes\n-the conversion script very chatty.\n-\n-The import checks out from CVS every revision of every file.  Reportedly\n-cvsimport can average some twenty revisions per second, so for a\n-medium-sized project this should not take more than a couple of minutes.\n-Larger projects or remote repositories may take longer.\n-\n-The main trunk is stored in the git branch named `origin`, and additional\n-CVS branches are stored in git branches with the same names.  The most\n-recent version of the main trunk is also left checked out on the `master`\n-branch, so you can start adding your own changes right away.\n-\n-The import is incremental, so if you call it again next month it will\n-fetch any CVS updates that have been made in the meantime.  For this to\n-work, you must not modify the imported branches; instead, create new\n-branches for your own changes, and merge in the imported branches as\n-necessary.\n-\n-Development Models\n-------------------\n-\n-CVS users are accustomed to giving a group of developers commit access to\n-a common repository.  In the next section we'll explain how to do this\n-with git.  However, the distributed nature of git allows other development\n-models, and you may want to first consider whether one of them might be a\n-better fit for your project.\n-\n-For example, you can choose a single person to maintain the project's\n-primary public repository.  Other developers then clone this repository\n-and each work in their own clone.  When they have a series of changes that\n-they're happy with, they ask the maintainer to pull from the branch\n-containing the changes.  The maintainer reviews their changes and pulls\n-them into the primary repository, which other developers pull from as\n-necessary to stay coordinated.  The Linux kernel and other projects use\n-variants of this model.\n-\n-With a small group, developers may just pull changes from each other's\n-repositories without the need for a central maintainer.\n-\n-Emulating the CVS Development Model\n+Developing against a CVS repository\n -----------------------------------\n \n-Start with an ordinary git working directory containing the project, and\n-remove the checked-out files, keeping just the bare .git directory:\n-\n-------------------------------------------------\n-$ mv project/.git /pub/repo.git\n-$ rm -r project/\n-------------------------------------------------\n-\n-Next, give every team member read/write access to this repository.  One\n-easy way to do this is to give all the team members ssh access to the\n-machine where the repository is hosted.  If you don't want to give them a\n-full shell on the machine, there is a restricted shell which only allows\n-users to do git pushes and pulls; see gitlink:git-shell[1].\n-\n-Put all the committers in the same group, and make the repository\n-writable by that group:\n-\n-------------------------------------------------\n-$ chgrp -R $group repo.git\n-$ find repo.git -mindepth 1 -type d |xargs chmod ug+rwx,g+s\n-$ GIT_DIR=repo.git git repo-config core.sharedrepository true\n-------------------------------------------------\n-\n-Make sure committers have a umask of at most 027, so that the directories\n-they create are writable and searchable by other group members.\n-\n-Suppose this repository is now set up in /pub/repo.git on the host\n+Suppose a shared repository is set up in /pub/repo.git on the host\n foo.com.  Then as an individual committer you can clone the shared\n-repository:\n+repository over ssh with:\n \n ------------------------------------------------\n $ git clone foo.com:/pub/repo.git/ my-project\n@@ -121,7 +29,8 @@ $ git pull origin\n ------------------------------------------------\n \n which merges in any work that others might have done since the clone\n-operation.\n+operation.  If there are uncommitted changes in your working tree, commit\n+them first before running git pull.\n \n [NOTE]\n ================================\n@@ -129,20 +38,22 @@ The first `git clone` places the following in the\n `my-project/.git/remotes/origin` file, and that's why the previous step\n and the next step both work.\n ------------\n-URL: foo.com:/pub/project.git/ my-project\n-Pull: master:origin\n+URL: foo.com:/pub/project.git/\n+Pull: refs/heads/master:refs/remotes/origin/master\n ------------\n ================================\n \n-You can update the shared repository with your changes using:\n+You can update the shared repository with your changes by first commiting\n+your changes, and then using:\n \n ------------------------------------------------\n $ git push origin master\n ------------------------------------------------\n \n-If someone else has updated the repository more recently, `git push`, like\n-`cvs commit`, will complain, in which case you must pull any changes\n-before attempting the push again.\n+to \"push\" those commits to the shared repository.  If someone else has\n+updated the repository more recently, `git push`, like `cvs commit`, will\n+complain, in which case you must pull any changes before attempting the\n+push again.\n \n In the `git push` command above we specify the name of the remote branch\n to update (`master`).  If we leave that out, `git push` tries to update\n@@ -151,21 +62,76 @@ in the local repository.  So the last `push` can be done with either of:\n \n ------------\n $ git push origin\n-$ git push repo.shared.xz:/pub/scm/project.git/\n+$ git push foo.com:/pub/project.git/\n ------------\n \n as long as the shared repository does not have any branches\n other than `master`.\n \n-[NOTE]\n-============\n-Because of this behavior, if the shared repository and the developer's\n-repository both have branches named `origin`, then a push like the above\n-attempts to update the `origin` branch in the shared repository from the\n-developer's `origin` branch.  The results may be unexpected, so it's\n-usually best to remove any branch named `origin` from the shared\n-repository.\n-============\n+Setting Up a Shared Repository\n+------------------------------\n+\n+We assume you have already created a git repository for your project,\n+possibly created from scratch or from a tarball (see the\n+link:tutorial.html[tutorial]), or imported from an already existing CVS\n+repository (see the next section).\n+\n+If your project's working directory is /home/alice/myproject, you can\n+create a shared repository at /pub/repo.git with:\n+\n+------------------------------------------------\n+$ git clone -bare /home/alice/myproject /pub/repo.git\n+------------------------------------------------\n+\n+Next, give every team member read/write access to this repository.  One\n+easy way to do this is to give all the team members ssh access to the\n+machine where the repository is hosted.  If you don't want to give them a\n+full shell on the machine, there is a restricted shell which only allows\n+users to do git pushes and pulls; see gitlink:git-shell[1].\n+\n+Put all the committers in the same group, and make the repository\n+writable by that group:\n+\n+------------------------------------------------\n+$ cd /pub\n+$ chgrp -R $group repo.git\n+$ find repo.git -mindepth 1 -type d |xargs chmod ug+rwx,g+s\n+$ GIT_DIR=repo.git git repo-config core.sharedrepository true\n+------------------------------------------------\n+\n+Make sure committers have a umask of at most 027, so that the directories\n+they create are writable and searchable by other group members.\n+\n+Importing a CVS archive\n+-----------------------\n+\n+First, install version 2.1 or higher of cvsps from\n+link:http://www.cobite.com/cvsps/[http://www.cobite.com/cvsps/] and make\n+sure it is in your path.  The magic command line is then\n+\n+-------------------------------------------\n+$ git cvsimport -v -d <cvsroot> -C <destination> <module>\n+-------------------------------------------\n+\n+This puts a git archive of the named CVS module in the directory\n+<destination>, which will be created if necessary.  The -v option makes\n+the conversion script very chatty.\n+\n+The import checks out from CVS every revision of every file.  Reportedly\n+cvsimport can average some twenty revisions per second, so for a\n+medium-sized project this should not take more than a couple of minutes.\n+Larger projects or remote repositories may take longer.\n+\n+The main trunk is stored in the git branch named `origin`, and additional\n+CVS branches are stored in git branches with the same names.  The most\n+recent version of the main trunk is also left checked out on the `master`\n+branch, so you can start adding your own changes right away.\n+\n+The import is incremental, so if you call it again next month it will\n+fetch any CVS updates that have been made in the meantime.  For this to\n+work, you must not modify the imported branches; instead, create new\n+branches for your own changes, and merge in the imported branches as\n+necessary.\n \n Advanced Shared Repository Management\n -------------------------------------\n@@ -178,127 +144,30 @@ You can enforce finer grained permissions using update hooks.  See\n link:howto/update-hook-example.txt[Controlling access to branches using\n update hooks].\n \n-CVS annotate\n-------------\n+Providing CVS Access to a git Repository\n+----------------------------------------\n+\n+It is also possible to provide true CVS access to a git repository, so\n+that developers can still use CVS; see gitlink:git-cvsserver[1] for\n+details.\n+\n+Alternative Development Models\n+------------------------------\n+\n+CVS users are accustomed to giving a group of developers commit access to\n+a common repository.  As we've seen, this is also possible with git.\n+However, the distributed nature of git allows other development models,\n+and you may want to first consider whether one of them might be a better\n+fit for your project.\n+\n+For example, you can choose a single person to maintain the project's\n+primary public repository.  Other developers then clone this repository\n+and each work in their own clone.  When they have a series of changes that\n+they're happy with, they ask the maintainer to pull from the branch\n+containing the changes.  The maintainer reviews their changes and pulls\n+them into the primary repository, which other developers pull from as\n+necessary to stay coordinated.  The Linux kernel and other projects use\n+variants of this model.\n \n-So, something has gone wrong, and you don't know whom to blame, and\n-you're an ex-CVS user and used to do \"cvs annotate\" to see who caused\n-the breakage. You're looking for the \"git annotate\", and it's just\n-claiming not to find such a script. You're annoyed.\n-\n-Yes, that's right.  Core git doesn't do \"annotate\", although it's\n-technically possible, and there are at least two specialized scripts out\n-there that can be used to get equivalent information (see the git\n-mailing list archives for details). \n-\n-git has a couple of alternatives, though, that you may find sufficient\n-or even superior depending on your use.  One is called \"git-whatchanged\"\n-(for obvious reasons) and the other one is called \"pickaxe\" (\"a tool for\n-the software archaeologist\"). \n-\n-The \"git-whatchanged\" script is a truly trivial script that can give you\n-a good overview of what has changed in a file or a directory (or an\n-arbitrary list of files or directories).  The \"pickaxe\" support is an\n-additional layer that can be used to further specify exactly what you're\n-looking for, if you already know the specific area that changed.\n-\n-Let's step back a bit and think about the reason why you would\n-want to do \"cvs annotate a-file.c\" to begin with.\n-\n-You would use \"cvs annotate\" on a file when you have trouble\n-with a function (or even a single \"if\" statement in a function)\n-that happens to be defined in the file, which does not do what\n-you want it to do.  And you would want to find out why it was\n-written that way, because you are about to modify it to suit\n-your needs, and at the same time you do not want to break its\n-current callers.  For that, you are trying to find out why the\n-original author did things that way in the original context.\n-\n-Many times, it may be enough to see the commit log messages of\n-commits that touch the file in question, possibly along with the\n-patches themselves, like this:\n-\n-\t$ git-whatchanged -p a-file.c\n-\n-This will show log messages and patches for each commit that\n-touches a-file.\n-\n-This, however, may not be very useful when this file has many\n-modifications that are not related to the piece of code you are\n-interested in.  You would see many log messages and patches that\n-do not have anything to do with the piece of code you are\n-interested in.  As an example, assuming that you have this piece\n-of code that you are interested in in the HEAD version:\n-\n-\tif (frotz) {\n-\t\tnitfol();\n-\t}\n-\n-you would use git-rev-list and git-diff-tree like this:\n-\n-\t$ git-rev-list HEAD |\n-\t  git-diff-tree --stdin -v -p -S'if (frotz) {\n-\t\tnitfol();\n-\t}'\n-\n-We have already talked about the \"\\--stdin\" form of git-diff-tree\n-command that reads the list of commits and compares each commit\n-with its parents (otherwise you should go back and read the tutorial).\n-The git-whatchanged command internally runs\n-the equivalent of the above command, and can be used like this:\n-\n-\t$ git-whatchanged -p -S'if (frotz) {\n-\t\tnitfol();\n-\t}'\n-\n-When the -S option is used, git-diff-tree command outputs\n-differences between two commits only if one tree has the\n-specified string in a file and the corresponding file in the\n-other tree does not.  The above example looks for a commit that\n-has the \"if\" statement in it in a file, but its parent commit\n-does not have it in the same shape in the corresponding file (or\n-the other way around, where the parent has it and the commit\n-does not), and the differences between them are shown, along\n-with the commit message (thanks to the -v flag).  It does not\n-show anything for commits that do not touch this \"if\" statement.\n-\n-Also, in the original context, the same statement might have\n-appeared at first in a different file and later the file was\n-renamed to \"a-file.c\".  CVS annotate would not help you to go\n-back across such a rename, but git would still help you in such\n-a situation.  For that, you can give the -C flag to\n-git-diff-tree, like this:\n-\n-\t$ git-whatchanged -p -C -S'if (frotz) {\n-\t\tnitfol();\n-\t}'\n-\n-When the -C flag is used, file renames and copies are followed.\n-So if the \"if\" statement in question happens to be in \"a-file.c\"\n-in the current HEAD commit, even if the file was originally\n-called \"o-file.c\" and then renamed in an earlier commit, or if\n-the file was created by copying an existing \"o-file.c\" in an\n-earlier commit, you will not lose track.  If the \"if\" statement\n-did not change across such a rename or copy, then the commit that\n-does rename or copy would not show in the output, and if the\n-\"if\" statement was modified while the file was still called\n-\"o-file.c\", it would find the commit that changed the statement\n-when it was in \"o-file.c\".\n-\n-NOTE: The current version of \"git-diff-tree -C\" is not eager\n-  enough to find copies, and it will miss the fact that a-file.c\n-  was created by copying o-file.c unless o-file.c was somehow\n-  changed in the same commit.\n-\n-You can use the --pickaxe-all flag in addition to the -S flag.\n-This causes the differences from all the files contained in\n-those two commits, not just the differences between the files\n-that contain this changed \"if\" statement:\n-\n-\t$ git-whatchanged -p -C -S'if (frotz) {\n-\t\tnitfol();\n-\t}' --pickaxe-all\n-\n-NOTE: This option is called \"--pickaxe-all\" because -S\n-  option is internally called \"pickaxe\", a tool for software\n-  archaeologists.\n+With a small group, developers may just pull changes from each other's\n+repositories without the need for a central maintainer.\n-- \n1.4.4.1.GIT\n"},{"id":"294663","messageId":"7vu008uucx.fsf@assigned-by-dhcp.cox.net","threadId":"43135","inReplyTo":"20061207041805.GC3457@fieldses.org","subject":"Re: [PATCH] Documentation: reorganize cvs-migration.txt","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-07T05:51:10Z","receivedAt":"2006-12-07T05:51:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J. Bruce Fields\" <bfields@fieldses.org> writes:\n\n> diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\n> index 6812683..773fc99 100644\n> --- a/Documentation/cvs-migration.txt\n> +++ b/Documentation/cvs-migration.txt\n> @@ -1,113 +1,21 @@\n\nThis conflicted in a funny way with your own commit but I think\nthis version (773fc99 blob) supersedes its contents.\n\nI munged only one line, though.  The title of this section \nshould not be \"a CVS repository\" but \"a shared repository\" for\nobvious reasons ;-).\n\n> +Developing against a CVS repository\n>  -----------------------------------\n>  \n> +Suppose a shared repository is set up in /pub/repo.git on the host\n>  foo.com.  Then as an individual committer you can clone the shared\n> +repository over ssh with:\n>  \n>  ------------------------------------------------\n>  $ git clone foo.com:/pub/repo.git/ my-project\n\n"},{"id":"295043","messageId":"Pine.LNX.4.63.0612071522080.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43135","inReplyTo":"20061207041805.GC3457@fieldses.org","subject":"Re: [PATCH] Documentation: reorganize cvs-migration.txt","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-07T14:28:33Z","receivedAt":"2006-12-07T14:28:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Dec 2006, J. Bruce Fields wrote:\n\n> Modify cvs-migration.txt so it explains first how to develop against a \n> shared repository, then how to set up a shared repository, then how to \n> import a repository from cvs.  Though this seems chronologically \n> backwards, it's still readable in this order, and it puts the more \n> commonly needed material closer to the front.\n\nThis is a laudable goal, and the order makes sense (put first that what \nmost people are interested in).\n\nA few comments:\n\n- just skimming the patch, I found \"commiting\" (needs another \"t\"), and \n  \"-bare\" (needs another \"-\").\n\n- It might make more sense to \"git init-db --shared\" and fetch the initial \n  revision into it, rather than clone it and then fix. You might also want\n  to mention that the \"--shared\" of -clone is different in meaning from \n  that of -init-db (make just a footnote of it, to avoid intimidating \n  readers).\n\n- By far the easiest method to import from cvs is to go to a checked out\n  _CVS_ working directory, and just say \"git cvsimport\".\n\nCiao,\nDscho\n"},{"id":"294001","messageId":"20061207152144.GA13613@fieldses.org","threadId":"43135","inReplyTo":"7vu008uucx.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Documentation: reorganize cvs-migration.txt","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-07T15:21:44Z","receivedAt":"2006-12-07T15:21:44Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Wed, Dec 06, 2006 at 09:51:10PM -0800, Junio C Hamano wrote:\n> \"J. Bruce Fields\" <bfields@fieldses.org> writes:\n> \n> > diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\n> > index 6812683..773fc99 100644\n> > --- a/Documentation/cvs-migration.txt\n> > +++ b/Documentation/cvs-migration.txt\n> > @@ -1,113 +1,21 @@\n> \n> This conflicted in a funny way with your own commit but I think\n> this version (773fc99 blob) supersedes its contents.\n\nOh, yeah, sorry, I should have made an incremental patch.\n\n> I munged only one line, though.  The title of this section \n> should not be \"a CVS repository\" but \"a shared repository\" for\n> obvious reasons ;-).\n\nOops, yes, thanks!\n\n"},{"id":"295389","messageId":"20061207174306.GC16858@fieldses.org","threadId":"43135","inReplyTo":"Pine.LNX.4.63.0612071522080.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Documentation: reorganize cvs-migration.txt","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-07T17:43:06Z","receivedAt":"2006-12-07T17:43:06Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Thu, Dec 07, 2006 at 03:28:33PM +0100, Johannes Schindelin wrote:\n> This is a laudable goal, and the order makes sense (put first that what \n> most people are interested in).\n> \n> A few comments:\n\nThanks for the comments!  Patch, incremental against the previous one,\nappended.\n\n> - just skimming the patch, I found \"commiting\" (needs another \"t\"), and \n>   \"-bare\" (needs another \"-\").\n\nGot it, thanks.\n\n> - It might make more sense to \"git init-db --shared\" and fetch the initial \n>   revision into it, rather than clone it and then fix.\n\nI do like the idea of anything that gets rid of the ugly find|xargs\nchmod.  Result included below (untested).  Is that what you were\nthinking of?\n\n>   You might also want\n>   to mention that the \"--shared\" of -clone is different in meaning from \n>   that of -init-db (make just a footnote of it, to avoid intimidating \n>   readers).\n\nI'm ignoring this for now.  We can add it later if someone says they've\nrun into it.  (But honestly it's partly just laziness on my part--no\nobjection if you want to make the patch.)\n\nIt's too bad about that option-name conflict.  It'd be nice just to be\nable to do the whole thing with one clone commandline.  And it'd also\nmake sense to allow clone and init-db to share commandline options where\nit made sense.\n\n> - By far the easiest method to import from cvs is to go to a checked out\n>   _CVS_ working directory, and just say \"git cvsimport\".\n\nNeat, I didn't know about that.  Done.  I left the \"-C\" in there on the\nassumption they often won't want to drop the result into the CVS working\ndirectory.\n\nAlso did some miscellaneous cleanup.\n\n--b.\n\ncommit 48ec79a74d0daa134b677ed5458beb873aa06e9a\nAuthor: J. Bruce Fields <bfields@citi.umich.edu>\nDate:   Thu Dec 7 12:38:09 2006 -0500\n\n    Documentation: simpler shared repo creation, miscellaneous cleanup\n    \n    Create the shared repo with init-db --shared, fetch, and manual extraction\n    of .git directory, instead of using clone --bare.\n    \n    Suggest running git-cvsimport from cvs working directory, more convenient\n    thatn providing all the CVS information on the commandline.\n    \n    Fix a couple mispellings, add a couple manpage links.\n    \n    Thanks to Johannes Schindelin.\n    \n    Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>\n\ndiff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\nindex 773fc99..4fab0d7 100644\n--- a/Documentation/cvs-migration.txt\n+++ b/Documentation/cvs-migration.txt\n@@ -43,8 +43,8 @@ Pull: refs/heads/master:refs/remotes/origin/master\n ------------\n ================================\n \n-You can update the shared repository with your changes by first commiting\n-your changes, and then using:\n+You can update the shared repository with your changes by first committing\n+your changes, and then using the gitlink:git-push[1] command:\n \n ------------------------------------------------\n $ git push origin master\n@@ -76,11 +76,23 @@ possibly created from scratch or from a tarball (see the\n link:tutorial.html[tutorial]), or imported from an already existing CVS\n repository (see the next section).\n \n-If your project's working directory is /home/alice/myproject, you can\n-create a shared repository at /pub/repo.git with:\n+Assume your existing repo is at /home/alice/myproject.  Create a temporary\n+empty shared repository and fetch your project into it:\n \n ------------------------------------------------\n-$ git clone -bare /home/alice/myproject /pub/repo.git\n+$ mkdir /pub/temporary\n+$ cd /pub/temporary\n+$ git init-db --shared\n+$ git fetch /home/alice/myproject master:master\n+------------------------------------------------\n+\n+Then create a \"bare\" repository at /pub/repo.git by just moving the contents of\n+the .git directory there.  The temporary repository can then be discarded.\n+\n+------------------------------------------------\n+$ mv .git /pub/repo.git\n+$ cd ..\n+$ rm -rf temporary\n ------------------------------------------------\n \n Next, give every team member read/write access to this repository.  One\n@@ -107,15 +119,15 @@ Importing a CVS archive\n \n First, install version 2.1 or higher of cvsps from\n link:http://www.cobite.com/cvsps/[http://www.cobite.com/cvsps/] and make\n-sure it is in your path.  The magic command line is then\n+sure it is in your path.  Then cd to a checked out CVS working directory\n+of the project you are interested in and run gitlink:git-cvsimport[1]:\n \n -------------------------------------------\n-$ git cvsimport -v -d <cvsroot> -C <destination> <module>\n+$ git cvsimport -C <destination>\n -------------------------------------------\n \n This puts a git archive of the named CVS module in the directory\n-<destination>, which will be created if necessary.  The -v option makes\n-the conversion script very chatty.\n+<destination>, which will be created if necessary.\n \n The import checks out from CVS every revision of every file.  Reportedly\n"},{"id":"296571","messageId":"Pine.LNX.4.63.0612071849340.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43135","inReplyTo":"20061207174306.GC16858@fieldses.org","subject":"Re: [PATCH] Documentation: reorganize cvs-migration.txt","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-07T17:50:50Z","receivedAt":"2006-12-07T17:50:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 7 Dec 2006, J. Bruce Fields wrote:\n\n> +$ mkdir /pub/temporary\n> +$ cd /pub/temporary\n> +$ git init-db --shared\n> +$ git fetch /home/alice/myproject master:master\n\nEven easier:\n\n$ mkdir /pub/my-repo.git\n$ cd /pub/my-repo.git\n$ git --bare init-db --shared\n$ git --bare fetch /home/alice/myproject master:master\n\n(Totally untested, of course.)\n\nCiao,\nDscho\n"},{"id":"294167","messageId":"20061208033400.GD30129@fieldses.org","threadId":"43135","inReplyTo":"Pine.LNX.4.63.0612071849340.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Documentation: reorganize cvs-migration.txt","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-08T03:34:00Z","receivedAt":"2006-12-08T03:34:00Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Thu, Dec 07, 2006 at 06:50:50PM +0100, Johannes Schindelin wrote:\n> Even easier:\n> \n> $ mkdir /pub/my-repo.git\n> $ cd /pub/my-repo.git\n> $ git --bare init-db --shared\n> $ git --bare fetch /home/alice/myproject master:master\n> \n> (Totally untested, of course.)\n\nOf course--for some reason I didn't think of doing init-db with --bare.\nThanks again.\n\n--b.\n\nFrom 22e5bdd9de398f29dfb11125a0921bb4529e2ab7 Mon Sep 17 00:00:00 2001\nFrom: J. Bruce Fields <bfields@citi.umich.edu>\nDate: Thu, 7 Dec 2006 22:32:28 -0500\nSubject: [PATCH] Documentation: simpler shared repository creation\n\nTake Johannes Schindelin's suggestion for a further simplification of the\nshared repository creation using git --bare init-db --shared.\n\nAlso fix a mistake from the previous patch: I forgot to remove the manual setup\nwhich the --shared does for us.\n\nSigned-off-by: J. Bruce Fields <bfields@citi.umich.edu>\n---\n Documentation/cvs-migration.txt |   27 ++++++++-------------------\n 1 files changed, 8 insertions(+), 19 deletions(-)\n\ndiff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\nindex 4fab0d7..20c5719 100644\n--- a/Documentation/cvs-migration.txt\n+++ b/Documentation/cvs-migration.txt\n@@ -76,23 +76,15 @@ possibly created from scratch or from a tarball (see the\n link:tutorial.html[tutorial]), or imported from an already existing CVS\n repository (see the next section).\n \n-Assume your existing repo is at /home/alice/myproject.  Create a temporary\n-empty shared repository and fetch your project into it:\n+Assume your existing repo is at /home/alice/myproject.  Create a new \"bare\"\n+repository (a repository without a working tree) and fetch your project into\n+it:\n \n ------------------------------------------------\n-$ mkdir /pub/temporary\n-$ cd /pub/temporary\n-$ git init-db --shared\n-$ git fetch /home/alice/myproject master:master\n-------------------------------------------------\n-\n-Then create a \"bare\" repository at /pub/repo.git by just moving the contents of\n-the .git directory there.  The temporary repository can then be discarded.\n-\n-------------------------------------------------\n-$ mv .git /pub/repo.git\n-$ cd ..\n-$ rm -rf temporary\n+$ mkdir /pub/my-repo.git\n+$ cd /pub/my-repo.git\n+$ git --bare init-db --shared\n+$ git --bare fetch /home/alice/myproject master:master\n ------------------------------------------------\n \n Next, give every team member read/write access to this repository.  One\n@@ -105,10 +97,7 @@ Put all the committers in the same group, and make the repository\n writable by that group:\n \n ------------------------------------------------\n-$ cd /pub\n-$ chgrp -R $group repo.git\n-$ find repo.git -mindepth 1 -type d |xargs chmod ug+rwx,g+s\n-$ GIT_DIR=repo.git git repo-config core.sharedrepository true\n+$ chgrp -R $group /pub/my-repo.git\n ------------------------------------------------\n \n Make sure committers have a umask of at most 027, so that the directories\n-- \n1.4.4.1.GIT\n"},{"id":"295978","messageId":"7vmz5yn92a.fsf@assigned-by-dhcp.cox.net","threadId":"43135","inReplyTo":"20061208033400.GD30129@fieldses.org","subject":"Re: [PATCH] Documentation: reorganize cvs-migration.txt","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-08T07:25:17Z","receivedAt":"2006-12-08T07:25:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J. Bruce Fields\" <bfields@fieldses.org> writes:\n\n> From 22e5bdd9de398f29dfb11125a0921bb4529e2ab7 Mon Sep 17 00:00:00 2001\n> From: J. Bruce Fields <bfields@citi.umich.edu>\n> Date: Thu, 7 Dec 2006 22:32:28 -0500\n> Subject: [PATCH] Documentation: simpler shared repository creation\n>\n> Take Johannes Schindelin's suggestion for a further simplification of the\n> shared repository creation using git --bare init-db --shared.\n>\n> Also fix a mistake from the previous patch: I forgot to remove the manual setup\n> which the --shared does for us.\n>\n> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>\n> ---\n>  Documentation/cvs-migration.txt |   27 ++++++++-------------------\n>  1 files changed, 8 insertions(+), 19 deletions(-)\n>\n> diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\n> index 4fab0d7..20c5719 100644\n\nWell, this does not apply at all, as I do not have a commit with\n4fab0d7 blob and already applied the reordering patch from you.\nCould you fix up and send again after I push out the latest?  I\ncould try to coax into the documentation, but since I am not\neven a CVS migrant myself and am known to be very bad at\ndocumentation, I _really_ don't think you want me to do so.\n\n;-)\n"},{"id":"298642","messageId":"20061209035850.GA18204@fieldses.org","threadId":"43135","inReplyTo":"7vmz5yn92a.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Documentation: reorganize cvs-migration.txt","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-12-09T03:58:50Z","receivedAt":"2006-12-09T03:58:50Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Thu, Dec 07, 2006 at 11:25:17PM -0800, Junio C Hamano wrote:\n> Well, this does not apply at all, as I do not have a commit with\n> 4fab0d7 blob and already applied the reordering patch from you.\n\nOK, sorry for the confusion.\n\n> Could you fix up and send again after I push out the latest?\n\nDefinitely.  Is this better?\n\n--b.\n\nDocumentation: simpler shared repository creation\n\nTake Johannes Schindelin's suggestions for a further simplification of\nthe shared repository creation using git --bare init-db --shared, and\nfor a simplified cvsimport using an existing CVS working directory.\n\nAlso insert more man page references.\n\nSigned-off-by: J. Bruce Fields <bfields@citi.umich.edu>\n\n cvs-migration.txt |   27 ++++++++++++++-------------\n 1 file changed, 14 insertions(+), 13 deletions(-)\n\n---\n\ndiff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\nindex 47846bd..b657f45 100644\n--- a/Documentation/cvs-migration.txt\n+++ b/Documentation/cvs-migration.txt\n@@ -43,8 +43,8 @@ Pull: refs/heads/master:refs/remotes/origin/master\n ------------\n ================================\n \n-You can update the shared repository with your changes by first commiting\n-your changes, and then using:\n+You can update the shared repository with your changes by first committing\n+your changes, and then using the gitlink:git-push[1] command:\n \n ------------------------------------------------\n $ git push origin master\n@@ -76,11 +76,15 @@ possibly created from scratch or from a tarball (see the\n link:tutorial.html[tutorial]), or imported from an already existing CVS\n repository (see the next section).\n \n-If your project's working directory is /home/alice/myproject, you can\n-create a shared repository at /pub/repo.git with:\n+Assume your existing repo is at /home/alice/myproject.  Create a new \"bare\"\n+repository (a repository without a working tree) and fetch your project into\n+it:\n \n ------------------------------------------------\n-$ git clone -bare /home/alice/myproject /pub/repo.git\n+$ mkdir /pub/my-repo.git\n+$ cd /pub/my-repo.git\n+$ git --bare init-db --shared\n+$ git --bare fetch /home/alice/myproject master:master\n ------------------------------------------------\n \n Next, give every team member read/write access to this repository.  One\n@@ -93,10 +97,7 @@ Put all the committers in the same group, and make the repository\n writable by that group:\n \n ------------------------------------------------\n-$ cd /pub\n-$ chgrp -R $group repo.git\n-$ find repo.git -mindepth 1 -type d |xargs chmod ug+rwx,g+s\n-$ GIT_DIR=repo.git git repo-config core.sharedrepository true\n+$ chgrp -R $group /pub/my-repo.git\n ------------------------------------------------\n \n Make sure committers have a umask of at most 027, so that the directories\n@@ -107,15 +108,15 @@ Importing a CVS archive\n \n First, install version 2.1 or higher of cvsps from\n link:http://www.cobite.com/cvsps/[http://www.cobite.com/cvsps/] and make\n-sure it is in your path.  The magic command line is then\n+sure it is in your path.  Then cd to a checked out CVS working directory\n+of the project you are interested in and run gitlink:git-cvsimport[1]:\n \n -------------------------------------------\n-$ git cvsimport -v -d <cvsroot> -C <destination> <module>\n+$ git cvsimport -C <destination>\n -------------------------------------------\n \n This puts a git archive of the named CVS module in the directory\n-<destination>, which will be created if necessary.  The -v option makes\n-the conversion script very chatty.\n+<destination>, which will be created if necessary.\n \n The import checks out from CVS every revision of every file.  Reportedly\n"}]}