git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git newbie problems
       [not found] ` <4574BF70.8070100@lilypond.org>
@ 2006-12-06  0:41   ` Graham Percival
  2006-12-06  1:23     ` Jakub Narebski
                       ` (3 more replies)
       [not found]   ` <45760545.2010801@gmail.com>
  1 sibling, 4 replies; 38+ messages in thread
From: Graham Percival @ 2006-12-06  0:41 UTC (permalink / raw
  To: git

Greetings,

I'm posting these problems at Han-Wen and Dscho's insistence.  I'm the 
documentation editor for GNU/LilyPond, so I'm reluctant to criticize 
other project's documentation unless I spend an hour or more seriously 
reading it.  I'm quite willing to admit that I never seriously tried to 
read the docs on the overall theory of git (branches, repo, etc); I just 
flailed around looking for magic commands to make things work.  By "make 
things work", I mean imitating my work style with cvs:

cvs co blah blah  (which I simply copy and paste from savannah)
while (true) {
   cvs update          // get changes that happened overnight
   vi foo/bar/baz.txt  // or whatever editing commands you do
   make; make web      // or whatever testing commands you do
   cvs update          // get latest changes to prepare for
                       // uploading my changes.
   cvs ci foo/bar/baz.txt  // upload changes
}

Once or twice a year I'll do "cvs diff" or "cvs add", but all I really 
want are the above commands.  I figured that this should be really easy 
to do, so I kept on skimming through the docs, trying to find the 
equivalent of these really easy commands.  (note that I was reading the 
"tutorial introduction to git")

I should add that I've received help on the lilypond-devel list; I'm 
posting this in case it helps future development for git docs, not 
because I need more help to use git.

This case was particularly difficult because the very first time I tried
to commit... err... push... err... "make my doc changes available to
everybody else" (whatever the right term is), there was this merge problem.



MERGE PROBLEM

Two people (me and another person) edited the same line on
Documentation/user/advanced.itely at the same time.  (note that this 
file has existed for over a year; it's not a new file)  When I tried to 
get the most recent changes, I'm greeted with this:
...
Trying really trivial in-index merge...
Documentation/user/advanced-notation.itely: needs merge
fatal: you need to resolve your current index first
Nope.
Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2
Merging:
038b7fc Misc small updates (trying to make git work).
c21d3f3 Merge branch 'master' of
ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
found 1 common ancestor(s):
84219bb don't have input/templates/ any longer.
fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
No merge strategy handled the merge.


As a git newbie, I'm quite confused.  OK, there's no merge strategy...
so what do I do now?  With cvs, the changes would be dumped into the
file.  I look at the file, found the conflict, and tried it again.  I
got the same error message, and then it occurred to me that although I
changed the files in my ~/usr/src/lilypond, git might be storing these
files somewhere else.  So I tried

$ git commit Documentation/user/advanced-notation.itely
Cannot do a partial commit during a merge.
You might have meant to say 'git commit -i paths...', perhaps?

... eh?  I'm trying to fix this so that you _can_ merge!  Regardless,
when I tried to update again, I get

$ git pull gnu master
...
Trying really trivial in-index merge...
fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
Nope.
Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2
Merging:
038b7fc Misc small updates (trying to make git work).
c21d3f3 Merge branch 'master' of
ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
found 1 common ancestor(s):
84219bb don't have input/templates/ any longer.
fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
No merge strategy handled the merge.


Now I'm totally confused, because I definitely haven't touched .gitignore.


SUGGESTIONS

The "tutorial introduction to git" looks like a nice document, but it
assumes that you are in control of the project.  For users who aren't in
control (ie me) this is a problem, because it starts me skimming.
"Importing a project"... nah, that's not me.  "Merging branches"... I
don't care; I'm going to shove everything into the main branch.  "Using
git for collaboration"... hmm, maybe this is the stuff I need to read.
But by this point, I've already skimmed through five screens of info, so
I'm not reading very carefully.

It would be nice to have an accompanying "tutorial introduction to
contributing with git" for users (like me) who are not in control of a 
project.

Finally, it would be really nice if there was some mention of "resolving
merge problems" in the tutorial (both in the current one and any new docs).

Cheers,
- Graham Percival


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
  2006-12-06  0:41   ` git newbie problems Graham Percival
@ 2006-12-06  1:23     ` Jakub Narebski
  2006-12-06  9:39       ` Han-Wen Nienhuys
  2006-12-06  1:35     ` Junio C Hamano
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 38+ messages in thread
From: Jakub Narebski @ 2006-12-06  1:23 UTC (permalink / raw
  To: git

Graham Percival wrote:

> Greetings,
> 
> I'm posting these problems at Han-Wen and Dscho's insistence.  I'm the 
> documentation editor for GNU/LilyPond, so I'm reluctant to criticize 
> other project's documentation unless I spend an hour or more seriously 
> reading it.  I'm quite willing to admit that I never seriously tried to 
> read the docs on the overall theory of git (branches, repo, etc); I just

Branches are very useful concept. And I really like the idea of branches in
git (the underlying concept of branch as lineage) and its implementation.
But because CVS had seriously screwed implementation of branches, you
probably didn't use it.

> flailed around looking for magic commands to make things work.  By "make 
> things work", I mean imitating my work style with cvs:

Perhaps it would be better to at least read cvs-migration.txt
  http://kernel.org/pub/software/scm/git/docs/cvs-migration.html
and all tutorials.

> cvs co blah blah  (which I simply copy and paste from savannah)
> while (true) {
>    cvs update          // get changes that happened overnight

"git pull", or "git fetch". "git pull" is more like in CVS, because it
merges the changes that happened overninght with your work.

>    vi foo/bar/baz.txt  // or whatever editing commands you do
>    make; make web      // or whatever testing commands you do

Those steps do not depend on version control used.

>    cvs update          // get latest changes to prepare for
>                        // uploading my changes.
>    cvs ci foo/bar/baz.txt  // upload changes

With git you do this sequence not in braindead CVS "update then commit"
which leads to rare commits (because you don't have time to resolve merge
conflicts for example), but commit then upload changes.

"git commit -a" to commit changes (the standard format of commit message
describing the change expected by history viewers is to write short
one-line description of changes, separate by empty line from longer
description if it is needed (it usually is): see
  http://git.or.cz/gitwiki/CommitMessageConventions
(and also other pages on GitDocumentation page at GitWiki as well)).

Then "git push" to propagate your changes (or if you don't have permissions
to push into repository, "git format-patch HEAD^.." and "git send-mail" to
propagate your changes via email).

> }
> 
> Once or twice a year I'll do "cvs diff" or "cvs add", but all I really 
> want are the above commands.  I figured that this should be really easy 
> to do, so I kept on skimming through the docs, trying to find the 
> equivalent of these really easy commands.  (note that I was reading the 
> "tutorial introduction to git")

There are some commands which CVS didn't have, and which are very useful
with git: I'm talking here about "git show" (show latest change), "git
log" (show kind of changelog), and gitk (graphical history viewer) or qgit
(alternate graphical history viewer in Qt).

It is also of note that you can move and rename files, soemthing CVS had
much problems with.
 
> I should add that I've received help on the lilypond-devel list; I'm 
> posting this in case it helps future development for git docs, not 
> because I need more help to use git.
> 
> This case was particularly difficult because the very first time I tried
> to commit... err... push... err... "make my doc changes available to
> everybody else" (whatever the right term is), there was this merge
> problem. 
> 
> 
> 
> MERGE PROBLEM
> 
> Two people (me and another person) edited the same line on
> Documentation/user/advanced.itely at the same time.  (note that this 
> file has existed for over a year; it's not a new file)  When I tried to 
> get the most recent changes, I'm greeted with this:
> ...
> Trying really trivial in-index merge...
> Documentation/user/advanced-notation.itely: needs merge
> fatal: you need to resolve your current index first
> Nope.
> Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2
> Merging:
> 038b7fc Misc small updates (trying to make git work).
> c21d3f3 Merge branch 'master' of
> ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
> found 1 common ancestor(s):
> 84219bb don't have input/templates/ any longer.
> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
> No merge strategy handled the merge.
>
> 
> As a git newbie, I'm quite confused.  OK, there's no merge strategy...
> so what do I do now?  With cvs, the changes would be dumped into the
> file.  I look at the file, found the conflict, and tried it again.  I
> got the same error message, and then it occurred to me that although I
> changed the files in my ~/usr/src/lilypond, git might be storing these
> files somewhere else.

Yes, the git error messages certainly needs to be made more user-friendly.
What git says here that one version has '.gitignore' file handled by version
control, and second has it outside version control. At least I think what
it does. "git ls-files --unmerged" or "git diff --merge --summary" should
show 'true conflicts'.

By the way, which version of git do you use? I think this particular check
(if it is the case of this error) was relaxed.

> So I tried
> $ git commit Documentation/user/advanced-notation.itely
> Cannot do a partial commit during a merge.
> You might have meant to say 'git commit -i paths...', perhaps?

Hint: usually "git reset" or even "git reset --hard" *warning: the latter
would overwrite your changes since last commit! use with care) is what you
want to do to 'clean up' after some interrupted command.

> ... eh?  I'm trying to fix this so that you _can_ merge!  Regardless,
> when I tried to update again, I get
> 
> $ git pull gnu master
> ...
> Trying really trivial in-index merge...
> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
> Nope.
> Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2
> Merging:
> 038b7fc Misc small updates (trying to make git work).
> c21d3f3 Merge branch 'master' of
> ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
> found 1 common ancestor(s):
> 84219bb don't have input/templates/ any longer.
> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
> No merge strategy handled the merge.
> 
> 
> Now I'm totally confused, because I definitely haven't touched .gitignore.

I'm guessing that "git add .gitignore", "git commit -a -m
'Added .gitignore'" before retyring pull/push would help in such situation. 

> SUGGESTIONS
> 
> The "tutorial introduction to git" looks like a nice document, but it
> assumes that you are in control of the project.  For users who aren't in
> control (ie me) this is a problem, because it starts me skimming.
> "Importing a project"... nah, that's not me.  "Merging branches"... I
> don't care; I'm going to shove everything into the main branch.  "Using
> git for collaboration"... hmm, maybe this is the stuff I need to read.
> But by this point, I've already skimmed through five screens of info, so
> I'm not reading very carefully.
> 
> It would be nice to have an accompanying "tutorial introduction to
> contributing with git" for users (like me) who are not in control of a 
> project.
> 
> Finally, it would be really nice if there was some mention of "resolving
> merge problems" in the tutorial (both in the current one and any new
> docs). 

Check out "[DRAFT] Branching and merging with git" thread

  Message-ID: <20061116221701.4499.qmail@science.horizon.com>
  http://permalink.gmane.org/gmane.comp.version-control.git/31625
  http://thread.gmane.org/gmane.comp.version-control.git/31625/ 

which I hope would end as Documentation/tutorial-3.txt. Or you can read jdl
presentation from OLS; check out GitLinks / GitDocumentation at GitWiki:
  
  http://git.or.cz/gitwiki/

> (please CC me as I am not subscribed to the mailist)

I also am not subsribed to the mailing list, but read the list via GMane
NNTP (news, Usenet) interface: see http://git.or.cz/gitwiki/GitCommunity

  nntp://news.gmane.org/gmane.comp.version-control.git

P.S. For wuick answers to "what to do now" questions you might use #git
channel on FreeNode.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
  2006-12-06  0:41   ` git newbie problems Graham Percival
  2006-12-06  1:23     ` Jakub Narebski
@ 2006-12-06  1:35     ` Junio C Hamano
  2006-12-06 22:19       ` Daniel Barkalow
  2006-12-06  1:52     ` Tom Prince
       [not found]     ` <el5608$952$2@sea.gmane.org>
  3 siblings, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2006-12-06  1:35 UTC (permalink / raw
  To: Graham Percival; +Cc: git

Graham Percival <gpermus@gmail.com> writes:

> Trying really trivial in-index merge...
> Documentation/user/advanced-notation.itely: needs merge
> fatal: you need to resolve your current index first

You got from a "git pull", which means you were already in
another merge (perhaps failed).  That is a no-no.

The error messages need to be cleaned up and be more helpful.
There is no question about it.

> Nope.
> Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2
> Merging:
> 038b7fc Misc small updates (trying to make git work).
> c21d3f3 Merge branch 'master' of
> ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
> found 1 common ancestor(s):
> 84219bb don't have input/templates/ any longer.
> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
> No merge strategy handled the merge.

So the question is what you did _before_ initiating this "git pull".

For new people, we recommend to:

 * make sure you were on a right branch (I think you are.  You
   are on your 'master' branch and may not even have any other
   branches, which is fine.)

 * make sure all your changes are committed.

before initiating a "git pull".  And after a conflicted "git
pull", if you choose to punt,

	$ git reset --hard

would take you back to the state before you started the pull.

> SUGGESTIONS
>
> The "tutorial introduction to git" looks like a nice document, but it
> assumes that you are in control of the project.  For users who aren't in
> control (ie me) this is a problem, because it starts me skimming.
> "Importing a project"... nah, that's not me.  "Merging branches"... I
> don't care; I'm going to shove everything into the main branch.  "Using
> git for collaboration"... hmm, maybe this is the stuff I need to read.
> But by this point, I've already skimmed through five screens of info, so
> I'm not reading very carefully.

Yes, git caters to too many classes of people.

I've heard people talk about "everyday" document as a good
table-of-contents, primarily because it first breaks down the
userbase into roles and talks about common commands for each
role of the user.  I am not in the position to judge the quality
of the document, though.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
  2006-12-06  0:41   ` git newbie problems Graham Percival
  2006-12-06  1:23     ` Jakub Narebski
  2006-12-06  1:35     ` Junio C Hamano
@ 2006-12-06  1:52     ` Tom Prince
       [not found]     ` <el5608$952$2@sea.gmane.org>
  3 siblings, 0 replies; 38+ messages in thread
From: Tom Prince @ 2006-12-06  1:52 UTC (permalink / raw
  To: Graham Percival; +Cc: git

On Tue, Dec 05, 2006 at 04:41:29PM -0800, Graham Percival wrote:
> Greetings,
> 
> I'm posting these problems at Han-Wen and Dscho's insistence.  I'm the 
> documentation editor for GNU/LilyPond, so I'm reluctant to criticize 
> other project's documentation unless I spend an hour or more seriously 
> reading it.

It is generally accepted that much of git documentation sucks in various ways,
and people have stepped up to help fix this. The problem is that most
people are already well-versed in git, which makes it harder to identify
the problem areas in the documentation, and that few people unfamiliar
with git post to report their problems with the documentation, or UI so
that, at least on the mailinglist itself, we get little direct feedback on the
documentation or UI.

Thank you from the list for your contribution.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
       [not found]     ` <el5608$952$2@sea.gmane.org>
@ 2006-12-06  8:01       ` Graham Percival
  0 siblings, 0 replies; 38+ messages in thread
From: Graham Percival @ 2006-12-06  8:01 UTC (permalink / raw
  To: Jakub Narebski; +Cc: git

Jakub Narebski wrote:
> Graham Percival wrote:
> 
>> flailed around looking for magic commands to make things work.  By "make 
>> things work", I mean imitating my work style with cvs:
> 
> Perhaps it would be better to at least read cvs-migration.txt
>   http://kernel.org/pub/software/scm/git/docs/cvs-migration.html
> and all tutorials.

I skimmed through the cvs-migration, the tutorial (part 1 and 2), and 
the "everyday git".  I didn't notice any "how to deal with merges 
problems"... it was unfortunate that the merge problems arose the very 
first time I tried to upload my changes.  If I had used git for a few 
days before it happened, I would have had more confidence to track down 
the problem (or email for help earlier!).

> There are some commands which CVS didn't have, and which are very useful
> with git: I'm talking here about "git show" (show latest change), "git
> log" (show kind of changelog), and gitk (graphical history viewer) or qgit
> (alternate graphical history viewer in Qt).

Yes, I don't doubt that git has many improvements -- the main developers 
of my project must have had some reason for moving away from cvs!  I'm 
speaking as a new user who wants to get very simple work done.  All I 
wanted to do was to fix a few typos in the lilypond documentation; the 
information about importing cvs projects or changing branches obscured 
the stuff I really wanted.


> Yes, the git error messages certainly needs to be made more user-friendly.
> What git says here that one version has '.gitignore' file handled by version
> control, and second has it outside version control. At least I think what
> it does. "git ls-files --unmerged" or "git diff --merge --summary" should
> show 'true conflicts'.

Thanks for the suggestions!

> By the way, which version of git do you use? I think this particular check
> (if it is the case of this error) was relaxed.

git version 1.4.4.1
I installed it via fink/unstable on OSX.

Cheers,

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
  2006-12-06  1:23     ` Jakub Narebski
@ 2006-12-06  9:39       ` Han-Wen Nienhuys
  2006-12-06 10:17         ` Jakub Narebski
  0 siblings, 1 reply; 38+ messages in thread
From: Han-Wen Nienhuys @ 2006-12-06  9:39 UTC (permalink / raw
  To: git


Jakub Narebski escreveu:
>> 84219bb don't have input/templates/ any longer.
>> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
>> No merge strategy handled the merge.
>>
>> As a git newbie, I'm quite confused.  OK, there's no merge strategy...
>> so what do I do now?  With cvs, the changes would be dumped into the
>> file.  I look at the file, found the conflict, and tried it again.  I
>> got the same error message, and then it occurred to me that although I
>> changed the files in my ~/usr/src/lilypond, git might be storing these
>> files somewhere else.
> 
> Yes, the git error messages certainly needs to be made more user-friendly.
> What git says here that one version has '.gitignore' file handled by version
> control, and second has it outside version control. At least I think what
> it does.

Which is actually not true. .gitignore has been in the repo since we
started using git.  I have also seen this message pop up a few times
in the beginning, but I can't recall why they happened.

-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git patch
       [not found]         ` <Pine.LNX.4.63.0612060157020.28348@wbgn013.biozentrum.uni-wuerzburg.de>
@ 2006-12-06  9:55           ` Han-Wen Nienhuys
  2006-12-06 10:00             ` Junio C Hamano
                               ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Han-Wen Nienhuys @ 2006-12-06  9:55 UTC (permalink / raw
  To: git; +Cc: lily-devel

Johannes Schindelin escreveu:
> The nice thing for me about Git: you never lose anything. Unless you say 
> "git prune" (in which case you really should know what you are doing), you 
> do not lose (committed) data.
> 
> Now, I promised to tell you what to do if all the files seem modified. Did 
> you look through "git -p diff"? (BTW with recent Git you only need "git 
> diff" and it will pipe the result into your pager automatically.)

This actually bothers me as well from a UI point of view.  Git-diff is
used both for generating diffs between versions that come from git and
the working tree/index.

I think it would be more logical to show those diffs as part of
git-status and perhaps git-commit, eg.

  git-commit --dry-run <commitoptions>

shows the diff of what would be committed

  git-status --diff

shows diffs of modified files in the working tree.

This makes it more clear what each diff means.

-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git patch
  2006-12-06  9:55           ` git patch Han-Wen Nienhuys
@ 2006-12-06 10:00             ` Junio C Hamano
  2006-12-06 10:22             ` Jakub Narebski
       [not found]             ` <Pine.LNX.4.63.0612061105220.28348@wbgn013.biozentrum.uni-wuerzburg.de>
  2 siblings, 0 replies; 38+ messages in thread
From: Junio C Hamano @ 2006-12-06 10:00 UTC (permalink / raw
  To: hanwen; +Cc: git

Han-Wen Nienhuys <hanwen@xs4all.nl> writes:

> I think it would be more logical to show those diffs as part of
> git-status and perhaps git-commit, eg.
>
>   git-commit --dry-run <commitoptions>
>
> shows the diff of what would be committed
>
>   git-status --diff
>
> shows diffs of modified files in the working tree.
>
> This makes it more clear what each diff means.

Just in case people did not know, "git status" is pronounced as
"git commit --dry-run".

It takes exactly the same set of parameters as "git commit", and
shows what would have been in the commit log message editor as
the status comments.

And it even takes the "-v" option that "git commit" takes.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
  2006-12-06  9:39       ` Han-Wen Nienhuys
@ 2006-12-06 10:17         ` Jakub Narebski
  2006-12-06 10:21           ` Han-Wen Nienhuys
  0 siblings, 1 reply; 38+ messages in thread
From: Jakub Narebski @ 2006-12-06 10:17 UTC (permalink / raw
  To: Han-Wen Nienhuys, Graham Percival; +Cc: git

Han-Wen Nienhuys wrote:
 
> Jakub Narebski escreveu:
>
>> Graham Percival wrote:
>>
>>> 84219bb don't have input/templates/ any longer.
>>> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
>>> No merge strategy handled the merge.
>>>
>>> As a git newbie, I'm quite confused.  OK, there's no merge strategy...

There is no merge strategy used, because problem (conflict) doesn't stem
from what was committed, but from what was in working directory.

>>> so what do I do now?  With cvs, the changes would be dumped into the
>>> file.  I look at the file, found the conflict, and tried it again.  I
>>> got the same error message, and then it occurred to me that although I
>>> changed the files in my ~/usr/src/lilypond, git might be storing these
>>> files somewhere else.
>> 
>> Yes, the git error messages certainly needs to be made more user-friendly.
>> What git says here that one version has '.gitignore' file handled by version
>> control, and second has it outside version control. At least I think what
>> it does.
> 
> Which is actually not true. .gitignore has been in the repo since we
> started using git.  I have also seen this message pop up a few times
> in the beginning, but I can't recall why they happened.

I don't know if git allows to pull into dirty tree with impunity. If I
remeber correctly Cogito (alternate UI for git) allows this[*1*], there is
currently work on this in git (but it is not as far as I remember in
git 1.4.4.1). So another possibility is induced by CVS "update then commit"
mentality pulling changes _before_ commiting changes.

If this is the case, committing changes _then_ pulling would solve this
problem.

Footnotes:
----------
[*1*] This is a bit error prone.
-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
  2006-12-06 10:17         ` Jakub Narebski
@ 2006-12-06 10:21           ` Han-Wen Nienhuys
  2006-12-06 10:42             ` Johannes Schindelin
  0 siblings, 1 reply; 38+ messages in thread
From: Han-Wen Nienhuys @ 2006-12-06 10:21 UTC (permalink / raw
  To: Jakub Narebski; +Cc: git

Jakub Narebski escreveu:

> I don't know if git allows to pull into dirty tree with impunity. If I
> remeber correctly Cogito (alternate UI for git) allows this[*1*], there is
> currently work on this in git (but it is not as far as I remember in
> git 1.4.4.1). So another possibility is induced by CVS "update then commit"
> mentality pulling changes _before_ commiting changes.

it is quite possibly a side-effect of cvs-habits. Note that in the beginning
I have wrestled to make git update the HEAD , eg. trying --update-head-ok

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git patch
  2006-12-06  9:55           ` git patch Han-Wen Nienhuys
  2006-12-06 10:00             ` Junio C Hamano
@ 2006-12-06 10:22             ` Jakub Narebski
       [not found]             ` <Pine.LNX.4.63.0612061105220.28348@wbgn013.biozentrum.uni-wuerzburg.de>
  2 siblings, 0 replies; 38+ messages in thread
From: Jakub Narebski @ 2006-12-06 10:22 UTC (permalink / raw
  To: git; +Cc: lilypond-devel

Han-Wen Nienhuys wrote:

> I think it would be more logical to show those diffs as part of
> git-status and perhaps git-commit, eg.
> 
>   git-commit --dry-run <commitoptions>
> 
> shows the diff of what would be committed
> 
>   git-status --diff
> 
> shows diffs of modified files in the working tree.
> 
> This makes it more clear what each diff means.

I'd rather say

  git-commit --diff

or

  git-diff --commit

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
  2006-12-06 10:21           ` Han-Wen Nienhuys
@ 2006-12-06 10:42             ` Johannes Schindelin
  0 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin @ 2006-12-06 10:42 UTC (permalink / raw
  To: Han-Wen Nienhuys; +Cc: Jakub Narebski, git

Hi,

On Wed, 6 Dec 2006, Han-Wen Nienhuys wrote:

> Note that in the beginning I have wrestled to make git update the HEAD , 
> eg. trying --update-head-ok

Ah! That would explain many of the problems! BTW where did you see that 
option mentioned? We should hide this option as deep in the technical 
lores of the documentation, fast.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git patch
       [not found]                 ` <Pine.LNX.4.63.0612061147540.28348@wbgn013.biozentrum.uni-wuerzburg.de>
@ 2006-12-06 11:27                   ` Han-Wen Nienhuys
  0 siblings, 0 replies; 38+ messages in thread
From: Han-Wen Nienhuys @ 2006-12-06 11:27 UTC (permalink / raw
  To: git; +Cc: lily-devel

Johannes Schindelin escreveu:
>> shows the diff of the change that he just introduced
> 
> Okay. But you mean
> 
> $ git commit --dry file1 file2...
> 
> or
> 
> $ git commit --dry -a


Well, --dry would be usable both with -a and file1, file2.

I agree with Jakub that --diff might be a better name, but it should 
be part of git-commit command, rather than the git-diff.

> Or, you use the script git-hunk-commit.bash which I posted. Which reminds 
> me: I wanted to rewrite it for you so it is more non-brand-new-bash 
> friendly.

:)

that's really nice, but actually recording separate hunks is a bit of
a headache if you have to do it over the command line. Under darcs, I
always use darcsum in emacs. In git, I always use git-status.
  
-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH] cvs-migration document: make the need for "push" more obvious
       [not found]     ` <20061206.105251.144349770.wl@gnu.org>
@ 2006-12-06 12:27       ` Johannes Schindelin
  2006-12-06 12:32         ` Jakub Narebski
  2006-12-06 14:52         ` Han-Wen Nienhuys
  0 siblings, 2 replies; 38+ messages in thread
From: Johannes Schindelin @ 2006-12-06 12:27 UTC (permalink / raw
  To: Werner LEMBERG; +Cc: gpermus, hanwen, git


It really is an important concept to grasp for people coming
from CVS. Even if it is briefly mentioned, it is not obvious
enough to sink in.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---

	On Wed, 6 Dec 2006, Werner LEMBERG wrote:
	
	> It took me a while to realize that a git repository, as soon as 
	> you've cloned it, is *self-contained*, and that commiting to the 
	> repository and synchronizing with a different git repository are 
	> two completely different things (contrary to CVS).  This should 
	> be pronounced more in the CVS->git guide.

 Documentation/cvs-migration.txt |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
index 6812683..8e610c7 100644
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -24,6 +24,11 @@ First, note some ways that git differs from CVS:
     single shared repository which people can synchronize with; see below
     for details.
 
+  * Since every working tree contains a repository, a commit will not
+    publish your changes; it will only create a revision. You have to
+    "push" your changes to a public repository to make them visible
+    to others.
+
 Importing a CVS archive
 -----------------------
 
-- 

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 12:27       ` [PATCH] cvs-migration document: make the need for "push" more obvious Johannes Schindelin
@ 2006-12-06 12:32         ` Jakub Narebski
  2006-12-06 13:14           ` Johannes Schindelin
  2006-12-06 14:52           ` J. Bruce Fields
  2006-12-06 14:52         ` Han-Wen Nienhuys
  1 sibling, 2 replies; 38+ messages in thread
From: Jakub Narebski @ 2006-12-06 12:32 UTC (permalink / raw
  To: git

Johannes Schindelin wrote:

> +  * Since every working tree contains a repository, a commit will not
> +    publish your changes; it will only create a revision. You have to
> +    "push" your changes to a public repository to make them visible
> +    to others.
> +

I'm not sure about context of this addition, but it is simply not
true if you publish your working repository. Granted, usually one
sets up bare public publishing repository...

By publish I mean set up http(s):// or git://, or ssh+git://, or local
transport.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 12:32         ` Jakub Narebski
@ 2006-12-06 13:14           ` Johannes Schindelin
  2006-12-06 13:27             ` Jakub Narebski
  2006-12-06 14:52           ` J. Bruce Fields
  1 sibling, 1 reply; 38+ messages in thread
From: Johannes Schindelin @ 2006-12-06 13:14 UTC (permalink / raw
  To: Jakub Narebski; +Cc: git

Hi,

On Wed, 6 Dec 2006, Jakub Narebski wrote:

> Johannes Schindelin wrote:
> 
> > +  * Since every working tree contains a repository, a commit will not
> > +    publish your changes; it will only create a revision. You have to
> > +    "push" your changes to a public repository to make them visible
> > +    to others.
> > +
> 
> I'm not sure about context of this addition, but it is simply not
> true if you publish your working repository.

Remember, you are talking to CVS users. They are not dumb, but sooo used 
to the CVS ways. So, they do not publish their working directory.

Later, when they became familiar with Git, you can tell them: "BTW you can 
also publish your working directory, but then you have to be extra careful 
with git-commit --amend, and if you allow pushing into your repo you have 
to add hooks to prevent updating your current HEAD, etc."

Give them a chance to get used to the concepts of Git.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 13:14           ` Johannes Schindelin
@ 2006-12-06 13:27             ` Jakub Narebski
  2006-12-06 13:32               ` New users, was " Johannes Schindelin
  0 siblings, 1 reply; 38+ messages in thread
From: Jakub Narebski @ 2006-12-06 13:27 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: git

Hi!

Johannes Schindelin wrote:

> On Wed, 6 Dec 2006, Jakub Narebski wrote:
> 
>> Johannes Schindelin wrote:
>> 
>>> +  * Since every working tree contains a repository, a commit will not
>>> +    publish your changes; it will only create a revision. You have to
>>> +    "push" your changes to a public repository to make them visible
>>> +    to others.
>>> +

I'd perhaps add here that it doesn't "push" your changes to a repository
you cloned from / you fetch from.
 
>> I'm not sure about context of this addition, but it is simply not
>> true if you publish your working repository.
> 
> Remember, you are talking to CVS users. They are not dumb, but sooo used 
> to the CVS ways. So, they do not publish their working directory.

So we are talking in context of having CVS-like one central repository
from which they pull / fetch, and to which they push?
 
> Later, when they became familiar with Git, you can tell them: "BTW you can 
> also publish your working directory, but then you have to be extra careful 
> with git-commit --amend, and if you allow pushing into your repo you have 
> to add hooks to prevent updating your current HEAD, etc."

I'd rather say that "publish your working repository", not "working
directory" here.

> Give them a chance to get used to the concepts of Git.

Well, it would be best to teach them concepts of git along.

-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 38+ messages in thread

* New users, was Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 13:27             ` Jakub Narebski
@ 2006-12-06 13:32               ` Johannes Schindelin
  0 siblings, 0 replies; 38+ messages in thread
From: Johannes Schindelin @ 2006-12-06 13:32 UTC (permalink / raw
  To: Jakub Narebski; +Cc: git

Hi,

On Wed, 6 Dec 2006, Jakub Narebski wrote:

> Johannes Schindelin wrote:
> 
> > Give them a chance to get used to the concepts of Git.
> 
> Well, it would be best to teach them concepts of git along.

NOOOOO!

It might surprise you that most users are not at all interested in how Git 
works. They just want to use the thing. And we should not try to make life 
hard on them. Teach them what they have to know _as quickly as possible_ 
so that they can continue to work. They'll come back for more.

If you make it as complicated as Malbolge to them, you will never know you 
lost a happy camper, because they _will not tell you_!

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 12:32         ` Jakub Narebski
  2006-12-06 13:14           ` Johannes Schindelin
@ 2006-12-06 14:52           ` J. Bruce Fields
  1 sibling, 0 replies; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-06 14:52 UTC (permalink / raw
  To: Jakub Narebski; +Cc: git

On Wed, Dec 06, 2006 at 01:32:32PM +0100, Jakub Narebski wrote:
> Johannes Schindelin wrote:
> 
> > +  * Since every working tree contains a repository, a commit will not
> > +    publish your changes; it will only create a revision. You have to
> > +    "push" your changes to a public repository to make them visible
> > +    to others.
> > +
> 
> I'm not sure about context of this addition, but it is simply not
> true if you publish your working repository. Granted, usually one
> sets up bare public publishing repository...

That's true, but this document is focused on the cvs-like case of
multiple private repos pushing to a single common public repo.

But we could replace "a commit will not publish" by "a commit in your
private repository will not publish"--which would make the statement
true without distracting from the main point.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 12:27       ` [PATCH] cvs-migration document: make the need for "push" more obvious Johannes Schindelin
  2006-12-06 12:32         ` Jakub Narebski
@ 2006-12-06 14:52         ` Han-Wen Nienhuys
  2006-12-06 14:58           ` J. Bruce Fields
  1 sibling, 1 reply; 38+ messages in thread
From: Han-Wen Nienhuys @ 2006-12-06 14:52 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: gpermus, hanwen, git

Johannes Schindelin escreveu:
> It really is an important concept to grasp for people coming
> from CVS. Even if it is briefly mentioned, it is not obvious
> enough to sink in.

I think the goal is laudable, but IMO it would be better to shorten
the document rather adding more text.

here is my try
 
From 980a0ca1b274e1219c24c3138f95e42206c72875 Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <hanwen@lilypond.org>
Date: Wed, 6 Dec 2006 15:50:13 +0100
Subject: [PATCH] another try at  rephrasing cvs doc.


Signed-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>
---
 Documentation/cvs-migration.txt |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
index 6812683..3270c57 100644
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -6,24 +6,36 @@ this document is to put you on the road to recovery, by helping you
 convert an existing cvs repository to git, and by showing you how to use a
 git repository in a cvs-like fashion.
 
-Some basic familiarity with git is required.  This
-link:tutorial.html[tutorial introduction to git] should be sufficient.
-
-First, note some ways that git differs from CVS:
+Git differs from CVS:
 
   * Commits are atomic and project-wide, not per-file as in CVS.
 
-  * Offline work is supported: you can make multiple commits locally,
+  * Branching is fast and easy.
+
+  * GIT is a distributed version control system:
+    This has several consequences:
+
+    - Every working tree contains a repository with a full copy of the
+    project history.
+    
+    - Offline work is supported: you can create revisions locally,
     then submit them when you're ready.
 
-  * Branching is fast and easy.
+    Hence, there is a difference between creating a revision
+    (the "commit" command) and submitting it (the "push" command).
+
+    - No repository is inherently more important than
+    any other.
+    
+    Of course, a project may still designate one central repository as
+    the True Master that contributors synchronize with.
+
+    See below for details.
 
-  * Every working tree contains a repository with a full copy of the
-    project history, and no repository is inherently more important than
-    any other.  However, you can emulate the CVS model by designating a
-    single shared repository which people can synchronize with; see below
-    for details.
+Some basic familiarity with git is required.  This
+link:tutorial.html[tutorial introduction to git] should be sufficient.
 
+    
 Importing a CVS archive
 -----------------------
 
-- 
1.4.4.1.gc9922-dirty


-- 

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 14:52         ` Han-Wen Nienhuys
@ 2006-12-06 14:58           ` J. Bruce Fields
  2006-12-06 15:05             ` Han-Wen Nienhuys
  2006-12-06 15:16             ` Johannes Schindelin
  0 siblings, 2 replies; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-06 14:58 UTC (permalink / raw
  To: Han-Wen Nienhuys; +Cc: Johannes Schindelin, gpermus, hanwen, git

On Wed, Dec 06, 2006 at 03:52:26PM +0100, Han-Wen Nienhuys wrote:
> Johannes Schindelin escreveu:
> > It really is an important concept to grasp for people coming
> > from CVS. Even if it is briefly mentioned, it is not obvious
> > enough to sink in.
> 
> I think the goal is laudable, but IMO it would be better to shorten
> the document rather adding more text.

OK, but...

>  Documentation/cvs-migration.txt |   34 +++++++++++++++++++++++-----------
>  1 files changed, 23 insertions(+), 11 deletions(-)

... that lengthens it even more than the proposed addition.

> +    Hence, there is a difference between creating a revision
> +    (the "commit" command) and submitting it (the "push" command).

I'd rather leave that introduction as it is--just as a section that
advertises the git features without trying to explain much.  And I'd
rather not mention push until we have a chance to explain how to use it.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 14:58           ` J. Bruce Fields
@ 2006-12-06 15:05             ` Han-Wen Nienhuys
  2006-12-06 15:16             ` Johannes Schindelin
  1 sibling, 0 replies; 38+ messages in thread
From: Han-Wen Nienhuys @ 2006-12-06 15:05 UTC (permalink / raw
  To: J. Bruce Fields; +Cc: Johannes Schindelin, gpermus, hanwen, git

J. Bruce Fields escreveu:
> On Wed, Dec 06, 2006 at 03:52:26PM +0100, Han-Wen Nienhuys wrote:
>> Johannes Schindelin escreveu:
>>> It really is an important concept to grasp for people coming
>>> from CVS. Even if it is briefly mentioned, it is not obvious
>>> enough to sink in.
>> I think the goal is laudable, but IMO it would be better to shorten
>> the document rather adding more text.
> 
> OK, but...
> 
>>  Documentation/cvs-migration.txt |   34 +++++++++++++++++++++++-----------
>>  1 files changed, 23 insertions(+), 11 deletions(-)
> 
> ... that lengthens it even more than the proposed addition.

Yes, but with white space.

> I'd rather leave that introduction as it is--just as a section that
> advertises the git features without trying to explain much.  And I'd
> rather not mention push until we have a chance to explain how to use it.

As was mentioned in another thread, it make more sense to split this file up 
into separate documents for project contributors and project admins.

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 14:58           ` J. Bruce Fields
  2006-12-06 15:05             ` Han-Wen Nienhuys
@ 2006-12-06 15:16             ` Johannes Schindelin
  2006-12-06 17:19               ` J. Bruce Fields
  1 sibling, 1 reply; 38+ messages in thread
From: Johannes Schindelin @ 2006-12-06 15:16 UTC (permalink / raw
  To: J. Bruce Fields; +Cc: Han-Wen Nienhuys, gpermus, hanwen, git

Hi,

On Wed, 6 Dec 2006, J. Bruce Fields wrote:

> I'd rather leave that introduction as it is--just as a section that 
> advertises the git features without trying to explain much.  And I'd 
> rather not mention push until we have a chance to explain how to use it.

You talk like you'd have an eternity to explain Git. But that is not true. 
A developer, especially those whom Git is forced upon, have an attention 
span shorter than their pub1c hair.

I _know_ that _I_ did not read the whole document about "Branching and 
merging in Git".

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 15:16             ` Johannes Schindelin
@ 2006-12-06 17:19               ` J. Bruce Fields
  2006-12-06 17:24                 ` J. Bruce Fields
  0 siblings, 1 reply; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-06 17:19 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: Han-Wen Nienhuys, gpermus, hanwen, git

On Wed, Dec 06, 2006 at 04:16:57PM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Wed, 6 Dec 2006, J. Bruce Fields wrote:
> 
> > I'd rather leave that introduction as it is--just as a section that 
> > advertises the git features without trying to explain much.  And I'd 
> > rather not mention push until we have a chance to explain how to use it.
> 
> You talk like you'd have an eternity to explain Git. But that is not true.
> A developer, especially those whom Git is forced upon, have an attention 
> span shorter than their pub1c hair.

Definitely, I agree.  So that argues for locating the most import stuff
as close to start of the document as possible.  But obviously there's
lot of important stuff and you can't do that with everything, so you
also have to rely on keeping things organized so people can more easily
skip to the middle.

The rest of the introduction is all git marketing: why you should like
using git instead of cvs.  So someone skimming for the quickest possible
"how do I make changes?" stuff may skip it entirely.

The thing that might help such a skimmer the most, actually, would be
a more helpful title for the section that actually does have what
they're looking for.  And making sure that particular section has the
right stuff.  How about something like this?

--b.

cvs-migration: improved section titles, better push/commit explanation

Rename the section titles to make the "how-to" content of the section
obvious.  Also clarify that changes have to be commited before they can
be pushed.

---

 cvs-migration.txt |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
index 6812683..726b48d 100644
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -76,8 +76,8 @@ variants of this model.
 With a small group, developers may just pull changes from each other's
 repositories without the need for a central maintainer.
 
-Emulating the CVS Development Model
------------------------------------
+Creating a Shared Repository
+----------------------------
 
 Start with an ordinary git working directory containing the project, and
 remove the checked-out files, keeping just the bare .git directory:
@@ -105,7 +105,10 @@ $ GIT_DIR=repo.git git repo-config core.
 Make sure committers have a umask of at most 027, so that the directories
 they create are writable and searchable by other group members.
 
-Suppose this repository is now set up in /pub/repo.git on the host
+Performing Development on a Shared Repository
+---------------------------------------------
+
+Suppose a repository is now set up in /pub/repo.git on the host
 foo.com.  Then as an individual committer you can clone the shared
 repository:
 
@@ -134,15 +137,17 @@ Pull: master:origin
 ------------
 ================================
 
-You can update the shared repository with your changes using:
+You can update the shared repository with your changes by first commiting
+your changes, and then using:
 
 ------------------------------------------------
 $ git push origin master
 ------------------------------------------------
 
-If someone else has updated the repository more recently, `git push`, like
-`cvs commit`, will complain, in which case you must pull any changes
-before attempting the push again.
+to "push" those commits to the shared repository.  If someone else has
+updated the repository more recently, `git push`, like `cvs commit`, will
+complain, in which case you must pull any changes before attempting the
+push again.
 
 In the `git push` command above we specify the name of the remote branch

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 17:19               ` J. Bruce Fields
@ 2006-12-06 17:24                 ` J. Bruce Fields
  2006-12-06 17:44                   ` Junio C Hamano
  2006-12-06 21:02                   ` [PATCH] cvs-migration document: make the need for "push" more obvious Graham Percival
  0 siblings, 2 replies; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-06 17:24 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: Han-Wen Nienhuys, gpermus, hanwen, git

On Wed, Dec 06, 2006 at 12:19:50PM -0500, J. Bruce Fields wrote:
> On Wed, Dec 06, 2006 at 04:16:57PM +0100, Johannes Schindelin wrote:
> Definitely, I agree.  So that argues for locating the most import stuff
> as close to start of the document as possible.  But obviously there's
> lot of important stuff and you can't do that with everything, so you
> also have to rely on keeping things organized so people can more easily
> skip to the middle.

Hm, but, come to think of it, I agree with you that the "how to commit
and push" really should come earlier, since that's the stuff most people
need to know; currently the order is roughly:

	importing a cvs archive
	creating a shared repository
	committing to a shared repository

We should start out with the assumption that a shared repo is already
set up and make it:

	committing to a shared repository
	creating a shared repository
	importing a cvs archive

which puts it in stuff-most-people-need-to-know to
stuff-less-people-need-to-know order.  Maybe the current introduction
should even be postponed to later.

And some day we should move that whole final CVS annotate section
elsewhere.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 17:24                 ` J. Bruce Fields
@ 2006-12-06 17:44                   ` Junio C Hamano
  2006-12-07  4:18                     ` [PATCH] Documentation: reorganize cvs-migration.txt J. Bruce Fields
  2006-12-06 21:02                   ` [PATCH] cvs-migration document: make the need for "push" more obvious Graham Percival
  1 sibling, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2006-12-06 17:44 UTC (permalink / raw
  To: J. Bruce Fields; +Cc: git

"J. Bruce Fields" <bfields@fieldses.org> writes:

> And some day we should move that whole final CVS annotate section
> elsewhere.

I agree that we should make that particular document shorter by
catering the immediate need of CVS migrant.  No need for git
marketting and showing off the power.

In that spirit, I think we can lose the section on 'annotate'
altogether now.  It was written in June 2005, way before
'annotate' and 'blame', both of which came in Feb 2006.


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 17:24                 ` J. Bruce Fields
  2006-12-06 17:44                   ` Junio C Hamano
@ 2006-12-06 21:02                   ` Graham Percival
  2006-12-06 21:45                     ` J. Bruce Fields
  1 sibling, 1 reply; 38+ messages in thread
From: Graham Percival @ 2006-12-06 21:02 UTC (permalink / raw
  To: J. Bruce Fields; +Cc: Johannes Schindelin, hanwen, git

J. Bruce Fields wrote:
> We should start out with the assumption that a shared repo is already
> set up and make it:
> 
> 	committing to a shared repository
> 	creating a shared repository
> 	importing a cvs archive
> 
> which puts it in stuff-most-people-need-to-know to
> stuff-less-people-need-to-know order.  Maybe the current introduction
> should even be postponed to later.

Yes, definitely!

I'm not complaining about changing to git, but Dscho's comment really 
rings true:

 > A developer, especially those whom Git is forced upon, have an
 > attention span shorter than their pub1c hair.

I'm in the middle of exam period, I have a term papers to write, and I 
have two weeks of lilypond bug reports and doc typos to process.  I 
don't care if git can do branches really nicely or walk my dog or cure 
cancer.  I can look at that stuff later -- right now I just want to fix 
things and upload them.

Cheers,

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] cvs-migration document: make the need for "push" more obvious
  2006-12-06 21:02                   ` [PATCH] cvs-migration document: make the need for "push" more obvious Graham Percival
@ 2006-12-06 21:45                     ` J. Bruce Fields
  0 siblings, 0 replies; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-06 21:45 UTC (permalink / raw
  To: Graham Percival; +Cc: Johannes Schindelin, hanwen, git

On Wed, Dec 06, 2006 at 01:02:58PM -0800, Graham Percival wrote:
> I'm in the middle of exam period, I have a term papers to write, and I 
> have two weeks of lilypond bug reports and doc typos to process.  I 
> don't care if git can do branches really nicely or walk my dog or cure 
> cancer.  I can look at that stuff later -- right now I just want to fix 
> things and upload them.

Yeah.  It's a tricky problem; different people need different things,
and to cover everything (and explain it correctly) the documentation
needs to be long; but to ensure that impatient people can get to what
they need quickly, there needs to be a short, clear path to their
particular need.

A few down-to-earth approaches that could help:

	- Clearer section/chapter titles, so we can generate tables of
	  contents where people can quickly find stuff--so, titles that
	  explain what the section will show you how to do with
	  minimized use of jargon that the user doesn't know yet ("how
	  to keep a repository up-to-date" as opposed to "git-fetch and
	  remotes").

	- As in "Everyday Git", think about what different groups of
	  users need.  But where possible, try to order documentation
	  with the stuff needed by the largest group of people first.
	  (For example, right now all the tutorials start with "git
	  init-db" and "git commit", assuming people are starting a
	  project from scratch, when the more typical usage is probably
	  someone joining an existing project, and possibly doing only
	  read-only stuff at first.)

	- Clearer ordering and dependencies, so when people find the "how
	  to resolve merges" section, they can quickly see what else
	  they'd need to read before that.  (And, yeah, I realize 99% of
	  the time they won't actually do that--they'll just dive right
	  in and try a few examples.  But at least they'll know where to
	  turn if that gets them in trouble....)


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: git newbie problems
  2006-12-06  1:35     ` Junio C Hamano
@ 2006-12-06 22:19       ` Daniel Barkalow
  0 siblings, 0 replies; 38+ messages in thread
From: Daniel Barkalow @ 2006-12-06 22:19 UTC (permalink / raw
  To: Junio C Hamano; +Cc: Graham Percival, git

On Tue, 5 Dec 2006, Junio C Hamano wrote:

> For new people, we recommend to:
> 
>  * make sure you were on a right branch (I think you are.  You
>    are on your 'master' branch and may not even have any other
>    branches, which is fine.)
> 
>  * make sure all your changes are committed.
> 
> before initiating a "git pull".  And after a conflicted "git
> pull", if you choose to punt,
> 
> 	$ git reset --hard
> 
> would take you back to the state before you started the pull.

If there are uncommitted changes, and there are conflicts, shouldn't it 
leave you in the state before the pull, especially if the uncommitted 
changes conflict with the merge? Git has determined that it can't present 
all of the conflicts to the user, so the user can't possibly resolve all 
of the conflicts, except by discarding new work or pushing it into the 
merge inappropriately. 

I think that a lot of new users will pull with uncommitted changes, and 
they'd benefit from just being told that you're supposed to commit first 
and then merge. It should definitely roll back perfectly to the state 
before the pull if it wasn't able to present all the conflicts, since even 
somebody who knows what's going on is going to have to roll back here.

Possibly there should even be an option (defaulting to true) which 
completely blocks "pull" with uncommitted changes. Even if the in-index 
merge works (and the working directory is entirely unneeded), it's pretty 
likely that the user would do better to be in the habit of doing it in the 
other order anyway.

	-Daniel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-06 17:44                   ` Junio C Hamano
@ 2006-12-07  4:18                     ` J. Bruce Fields
  2006-12-07  5:51                       ` Junio C Hamano
  2006-12-07 14:28                       ` Johannes Schindelin
  0 siblings, 2 replies; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-07  4:18 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git

Modify cvs-migration.txt so it explains first how to develop against a
shared repository, then how to set up a shared repository, then how to
import a repository from cvs.  Though this seems chronologically
backwards, it's still readable in this order, and it puts the more
commonly needed material closer to the front.

Remove the annotate/pickaxe section; perhaps it can find a place elsewhere
in the future.  Remove most of the "why git is better than cvs" stuff from
the introduction.

Add some minor clarifications, including two that have come up several
times on the mailing list:

	1. Recommend committing any changes before running pull.
	2. Note that changes must be commited before they can be pushed.

Update the clone discussion to reflect the new --use-separate-remotes
default, and add a brief mention of git-cvsserver.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
 Documentation/cvs-migration.txt |  349 ++++++++++++---------------------------
 1 files changed, 109 insertions(+), 240 deletions(-)

diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
index 6812683..773fc99 100644
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -1,113 +1,21 @@
 git for CVS users
 =================
 
-So you're a CVS user. That's OK, it's a treatable condition.  The job of
-this document is to put you on the road to recovery, by helping you
-convert an existing cvs repository to git, and by showing you how to use a
-git repository in a cvs-like fashion.
+Git differs from CVS in that every working tree contains a repository with
+a full copy of the project history, and no repository is inherently more
+important than any other.  However, you can emulate the CVS model by
+designating a single shared repository which people can synchronize with;
+this document explains how to do that.
 
 Some basic familiarity with git is required.  This
 link:tutorial.html[tutorial introduction to git] should be sufficient.
 
-First, note some ways that git differs from CVS:
-
-  * Commits are atomic and project-wide, not per-file as in CVS.
-
-  * Offline work is supported: you can make multiple commits locally,
-    then submit them when you're ready.
-
-  * Branching is fast and easy.
-
-  * Every working tree contains a repository with a full copy of the
-    project history, and no repository is inherently more important than
-    any other.  However, you can emulate the CVS model by designating a
-    single shared repository which people can synchronize with; see below
-    for details.
-
-Importing a CVS archive
------------------------
-
-First, install version 2.1 or higher of cvsps from
-link:http://www.cobite.com/cvsps/[http://www.cobite.com/cvsps/] and make
-sure it is in your path.  The magic command line is then
-
--------------------------------------------
-$ git cvsimport -v -d <cvsroot> -C <destination> <module>
--------------------------------------------
-
-This puts a git archive of the named CVS module in the directory
-<destination>, which will be created if necessary.  The -v option makes
-the conversion script very chatty.
-
-The import checks out from CVS every revision of every file.  Reportedly
-cvsimport can average some twenty revisions per second, so for a
-medium-sized project this should not take more than a couple of minutes.
-Larger projects or remote repositories may take longer.
-
-The main trunk is stored in the git branch named `origin`, and additional
-CVS branches are stored in git branches with the same names.  The most
-recent version of the main trunk is also left checked out on the `master`
-branch, so you can start adding your own changes right away.
-
-The import is incremental, so if you call it again next month it will
-fetch any CVS updates that have been made in the meantime.  For this to
-work, you must not modify the imported branches; instead, create new
-branches for your own changes, and merge in the imported branches as
-necessary.
-
-Development Models
-------------------
-
-CVS users are accustomed to giving a group of developers commit access to
-a common repository.  In the next section we'll explain how to do this
-with git.  However, the distributed nature of git allows other development
-models, and you may want to first consider whether one of them might be a
-better fit for your project.
-
-For example, you can choose a single person to maintain the project's
-primary public repository.  Other developers then clone this repository
-and each work in their own clone.  When they have a series of changes that
-they're happy with, they ask the maintainer to pull from the branch
-containing the changes.  The maintainer reviews their changes and pulls
-them into the primary repository, which other developers pull from as
-necessary to stay coordinated.  The Linux kernel and other projects use
-variants of this model.
-
-With a small group, developers may just pull changes from each other's
-repositories without the need for a central maintainer.
-
-Emulating the CVS Development Model
+Developing against a CVS repository
 -----------------------------------
 
-Start with an ordinary git working directory containing the project, and
-remove the checked-out files, keeping just the bare .git directory:
-
-------------------------------------------------
-$ mv project/.git /pub/repo.git
-$ rm -r project/
-------------------------------------------------
-
-Next, give every team member read/write access to this repository.  One
-easy way to do this is to give all the team members ssh access to the
-machine where the repository is hosted.  If you don't want to give them a
-full shell on the machine, there is a restricted shell which only allows
-users to do git pushes and pulls; see gitlink:git-shell[1].
-
-Put all the committers in the same group, and make the repository
-writable by that group:
-
-------------------------------------------------
-$ chgrp -R $group repo.git
-$ find repo.git -mindepth 1 -type d |xargs chmod ug+rwx,g+s
-$ GIT_DIR=repo.git git repo-config core.sharedrepository true
-------------------------------------------------
-
-Make sure committers have a umask of at most 027, so that the directories
-they create are writable and searchable by other group members.
-
-Suppose this repository is now set up in /pub/repo.git on the host
+Suppose a shared repository is set up in /pub/repo.git on the host
 foo.com.  Then as an individual committer you can clone the shared
-repository:
+repository over ssh with:
 
 ------------------------------------------------
 $ git clone foo.com:/pub/repo.git/ my-project
@@ -121,7 +29,8 @@ $ git pull origin
 ------------------------------------------------
 
 which merges in any work that others might have done since the clone
-operation.
+operation.  If there are uncommitted changes in your working tree, commit
+them first before running git pull.
 
 [NOTE]
 ================================
@@ -129,20 +38,22 @@ The first `git clone` places the following in the
 `my-project/.git/remotes/origin` file, and that's why the previous step
 and the next step both work.
 ------------
-URL: foo.com:/pub/project.git/ my-project
-Pull: master:origin
+URL: foo.com:/pub/project.git/
+Pull: refs/heads/master:refs/remotes/origin/master
 ------------
 ================================
 
-You can update the shared repository with your changes using:
+You can update the shared repository with your changes by first commiting
+your changes, and then using:
 
 ------------------------------------------------
 $ git push origin master
 ------------------------------------------------
 
-If someone else has updated the repository more recently, `git push`, like
-`cvs commit`, will complain, in which case you must pull any changes
-before attempting the push again.
+to "push" those commits to the shared repository.  If someone else has
+updated the repository more recently, `git push`, like `cvs commit`, will
+complain, in which case you must pull any changes before attempting the
+push again.
 
 In the `git push` command above we specify the name of the remote branch
 to update (`master`).  If we leave that out, `git push` tries to update
@@ -151,21 +62,76 @@ in the local repository.  So the last `push` can be done with either of:
 
 ------------
 $ git push origin
-$ git push repo.shared.xz:/pub/scm/project.git/
+$ git push foo.com:/pub/project.git/
 ------------
 
 as long as the shared repository does not have any branches
 other than `master`.
 
-[NOTE]
-============
-Because of this behavior, if the shared repository and the developer's
-repository both have branches named `origin`, then a push like the above
-attempts to update the `origin` branch in the shared repository from the
-developer's `origin` branch.  The results may be unexpected, so it's
-usually best to remove any branch named `origin` from the shared
-repository.
-============
+Setting Up a Shared Repository
+------------------------------
+
+We assume you have already created a git repository for your project,
+possibly created from scratch or from a tarball (see the
+link:tutorial.html[tutorial]), or imported from an already existing CVS
+repository (see the next section).
+
+If your project's working directory is /home/alice/myproject, you can
+create a shared repository at /pub/repo.git with:
+
+------------------------------------------------
+$ git clone -bare /home/alice/myproject /pub/repo.git
+------------------------------------------------
+
+Next, give every team member read/write access to this repository.  One
+easy way to do this is to give all the team members ssh access to the
+machine where the repository is hosted.  If you don't want to give them a
+full shell on the machine, there is a restricted shell which only allows
+users to do git pushes and pulls; see gitlink:git-shell[1].
+
+Put all the committers in the same group, and make the repository
+writable by that group:
+
+------------------------------------------------
+$ cd /pub
+$ chgrp -R $group repo.git
+$ find repo.git -mindepth 1 -type d |xargs chmod ug+rwx,g+s
+$ GIT_DIR=repo.git git repo-config core.sharedrepository true
+------------------------------------------------
+
+Make sure committers have a umask of at most 027, so that the directories
+they create are writable and searchable by other group members.
+
+Importing a CVS archive
+-----------------------
+
+First, install version 2.1 or higher of cvsps from
+link:http://www.cobite.com/cvsps/[http://www.cobite.com/cvsps/] and make
+sure it is in your path.  The magic command line is then
+
+-------------------------------------------
+$ git cvsimport -v -d <cvsroot> -C <destination> <module>
+-------------------------------------------
+
+This puts a git archive of the named CVS module in the directory
+<destination>, which will be created if necessary.  The -v option makes
+the conversion script very chatty.
+
+The import checks out from CVS every revision of every file.  Reportedly
+cvsimport can average some twenty revisions per second, so for a
+medium-sized project this should not take more than a couple of minutes.
+Larger projects or remote repositories may take longer.
+
+The main trunk is stored in the git branch named `origin`, and additional
+CVS branches are stored in git branches with the same names.  The most
+recent version of the main trunk is also left checked out on the `master`
+branch, so you can start adding your own changes right away.
+
+The import is incremental, so if you call it again next month it will
+fetch any CVS updates that have been made in the meantime.  For this to
+work, you must not modify the imported branches; instead, create new
+branches for your own changes, and merge in the imported branches as
+necessary.
 
 Advanced Shared Repository Management
 -------------------------------------
@@ -178,127 +144,30 @@ You can enforce finer grained permissions using update hooks.  See
 link:howto/update-hook-example.txt[Controlling access to branches using
 update hooks].
 
-CVS annotate
-------------
+Providing CVS Access to a git Repository
+----------------------------------------
+
+It is also possible to provide true CVS access to a git repository, so
+that developers can still use CVS; see gitlink:git-cvsserver[1] for
+details.
+
+Alternative Development Models
+------------------------------
+
+CVS users are accustomed to giving a group of developers commit access to
+a common repository.  As we've seen, this is also possible with git.
+However, the distributed nature of git allows other development models,
+and you may want to first consider whether one of them might be a better
+fit for your project.
+
+For example, you can choose a single person to maintain the project's
+primary public repository.  Other developers then clone this repository
+and each work in their own clone.  When they have a series of changes that
+they're happy with, they ask the maintainer to pull from the branch
+containing the changes.  The maintainer reviews their changes and pulls
+them into the primary repository, which other developers pull from as
+necessary to stay coordinated.  The Linux kernel and other projects use
+variants of this model.
 
-So, something has gone wrong, and you don't know whom to blame, and
-you're an ex-CVS user and used to do "cvs annotate" to see who caused
-the breakage. You're looking for the "git annotate", and it's just
-claiming not to find such a script. You're annoyed.
-
-Yes, that's right.  Core git doesn't do "annotate", although it's
-technically possible, and there are at least two specialized scripts out
-there that can be used to get equivalent information (see the git
-mailing list archives for details). 
-
-git has a couple of alternatives, though, that you may find sufficient
-or even superior depending on your use.  One is called "git-whatchanged"
-(for obvious reasons) and the other one is called "pickaxe" ("a tool for
-the software archaeologist"). 
-
-The "git-whatchanged" script is a truly trivial script that can give you
-a good overview of what has changed in a file or a directory (or an
-arbitrary list of files or directories).  The "pickaxe" support is an
-additional layer that can be used to further specify exactly what you're
-looking for, if you already know the specific area that changed.
-
-Let's step back a bit and think about the reason why you would
-want to do "cvs annotate a-file.c" to begin with.
-
-You would use "cvs annotate" on a file when you have trouble
-with a function (or even a single "if" statement in a function)
-that happens to be defined in the file, which does not do what
-you want it to do.  And you would want to find out why it was
-written that way, because you are about to modify it to suit
-your needs, and at the same time you do not want to break its
-current callers.  For that, you are trying to find out why the
-original author did things that way in the original context.
-
-Many times, it may be enough to see the commit log messages of
-commits that touch the file in question, possibly along with the
-patches themselves, like this:
-
-	$ git-whatchanged -p a-file.c
-
-This will show log messages and patches for each commit that
-touches a-file.
-
-This, however, may not be very useful when this file has many
-modifications that are not related to the piece of code you are
-interested in.  You would see many log messages and patches that
-do not have anything to do with the piece of code you are
-interested in.  As an example, assuming that you have this piece
-of code that you are interested in in the HEAD version:
-
-	if (frotz) {
-		nitfol();
-	}
-
-you would use git-rev-list and git-diff-tree like this:
-
-	$ git-rev-list HEAD |
-	  git-diff-tree --stdin -v -p -S'if (frotz) {
-		nitfol();
-	}'
-
-We have already talked about the "\--stdin" form of git-diff-tree
-command that reads the list of commits and compares each commit
-with its parents (otherwise you should go back and read the tutorial).
-The git-whatchanged command internally runs
-the equivalent of the above command, and can be used like this:
-
-	$ git-whatchanged -p -S'if (frotz) {
-		nitfol();
-	}'
-
-When the -S option is used, git-diff-tree command outputs
-differences between two commits only if one tree has the
-specified string in a file and the corresponding file in the
-other tree does not.  The above example looks for a commit that
-has the "if" statement in it in a file, but its parent commit
-does not have it in the same shape in the corresponding file (or
-the other way around, where the parent has it and the commit
-does not), and the differences between them are shown, along
-with the commit message (thanks to the -v flag).  It does not
-show anything for commits that do not touch this "if" statement.
-
-Also, in the original context, the same statement might have
-appeared at first in a different file and later the file was
-renamed to "a-file.c".  CVS annotate would not help you to go
-back across such a rename, but git would still help you in such
-a situation.  For that, you can give the -C flag to
-git-diff-tree, like this:
-
-	$ git-whatchanged -p -C -S'if (frotz) {
-		nitfol();
-	}'
-
-When the -C flag is used, file renames and copies are followed.
-So if the "if" statement in question happens to be in "a-file.c"
-in the current HEAD commit, even if the file was originally
-called "o-file.c" and then renamed in an earlier commit, or if
-the file was created by copying an existing "o-file.c" in an
-earlier commit, you will not lose track.  If the "if" statement
-did not change across such a rename or copy, then the commit that
-does rename or copy would not show in the output, and if the
-"if" statement was modified while the file was still called
-"o-file.c", it would find the commit that changed the statement
-when it was in "o-file.c".
-
-NOTE: The current version of "git-diff-tree -C" is not eager
-  enough to find copies, and it will miss the fact that a-file.c
-  was created by copying o-file.c unless o-file.c was somehow
-  changed in the same commit.
-
-You can use the --pickaxe-all flag in addition to the -S flag.
-This causes the differences from all the files contained in
-those two commits, not just the differences between the files
-that contain this changed "if" statement:
-
-	$ git-whatchanged -p -C -S'if (frotz) {
-		nitfol();
-	}' --pickaxe-all
-
-NOTE: This option is called "--pickaxe-all" because -S
-  option is internally called "pickaxe", a tool for software
-  archaeologists.
+With a small group, developers may just pull changes from each other's
+repositories without the need for a central maintainer.
-- 
1.4.4.1.GIT

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-07  4:18                     ` [PATCH] Documentation: reorganize cvs-migration.txt J. Bruce Fields
@ 2006-12-07  5:51                       ` Junio C Hamano
  2006-12-07 15:21                         ` J. Bruce Fields
  2006-12-07 14:28                       ` Johannes Schindelin
  1 sibling, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2006-12-07  5:51 UTC (permalink / raw
  To: J. Bruce Fields; +Cc: git

"J. Bruce Fields" <bfields@fieldses.org> writes:

> diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
> index 6812683..773fc99 100644
> --- a/Documentation/cvs-migration.txt
> +++ b/Documentation/cvs-migration.txt
> @@ -1,113 +1,21 @@

This conflicted in a funny way with your own commit but I think
this version (773fc99 blob) supersedes its contents.

I munged only one line, though.  The title of this section 
should not be "a CVS repository" but "a shared repository" for
obvious reasons ;-).

> +Developing against a CVS repository
>  -----------------------------------
>  
> +Suppose a shared repository is set up in /pub/repo.git on the host
>  foo.com.  Then as an individual committer you can clone the shared
> +repository over ssh with:
>  
>  ------------------------------------------------
>  $ git clone foo.com:/pub/repo.git/ my-project


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-07  4:18                     ` [PATCH] Documentation: reorganize cvs-migration.txt J. Bruce Fields
  2006-12-07  5:51                       ` Junio C Hamano
@ 2006-12-07 14:28                       ` Johannes Schindelin
  2006-12-07 17:43                         ` J. Bruce Fields
  1 sibling, 1 reply; 38+ messages in thread
From: Johannes Schindelin @ 2006-12-07 14:28 UTC (permalink / raw
  To: J. Bruce Fields; +Cc: Junio C Hamano, git

Hi,

On Wed, 6 Dec 2006, J. Bruce Fields wrote:

> Modify cvs-migration.txt so it explains first how to develop against a 
> shared repository, then how to set up a shared repository, then how to 
> import a repository from cvs.  Though this seems chronologically 
> backwards, it's still readable in this order, and it puts the more 
> commonly needed material closer to the front.

This is a laudable goal, and the order makes sense (put first that what 
most people are interested in).

A few comments:

- just skimming the patch, I found "commiting" (needs another "t"), and 
  "-bare" (needs another "-").

- It might make more sense to "git init-db --shared" and fetch the initial 
  revision into it, rather than clone it and then fix. You might also want
  to mention that the "--shared" of -clone is different in meaning from 
  that of -init-db (make just a footnote of it, to avoid intimidating 
  readers).

- By far the easiest method to import from cvs is to go to a checked out
  _CVS_ working directory, and just say "git cvsimport".

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-07  5:51                       ` Junio C Hamano
@ 2006-12-07 15:21                         ` J. Bruce Fields
  0 siblings, 0 replies; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-07 15:21 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git

On Wed, Dec 06, 2006 at 09:51:10PM -0800, Junio C Hamano wrote:
> "J. Bruce Fields" <bfields@fieldses.org> writes:
> 
> > diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
> > index 6812683..773fc99 100644
> > --- a/Documentation/cvs-migration.txt
> > +++ b/Documentation/cvs-migration.txt
> > @@ -1,113 +1,21 @@
> 
> This conflicted in a funny way with your own commit but I think
> this version (773fc99 blob) supersedes its contents.

Oh, yeah, sorry, I should have made an incremental patch.

> I munged only one line, though.  The title of this section 
> should not be "a CVS repository" but "a shared repository" for
> obvious reasons ;-).

Oops, yes, thanks!


^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-07 14:28                       ` Johannes Schindelin
@ 2006-12-07 17:43                         ` J. Bruce Fields
  2006-12-07 17:50                           ` Johannes Schindelin
  0 siblings, 1 reply; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-07 17:43 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

On Thu, Dec 07, 2006 at 03:28:33PM +0100, Johannes Schindelin wrote:
> This is a laudable goal, and the order makes sense (put first that what 
> most people are interested in).
> 
> A few comments:

Thanks for the comments!  Patch, incremental against the previous one,
appended.

> - just skimming the patch, I found "commiting" (needs another "t"), and 
>   "-bare" (needs another "-").

Got it, thanks.

> - It might make more sense to "git init-db --shared" and fetch the initial 
>   revision into it, rather than clone it and then fix.

I do like the idea of anything that gets rid of the ugly find|xargs
chmod.  Result included below (untested).  Is that what you were
thinking of?

>   You might also want
>   to mention that the "--shared" of -clone is different in meaning from 
>   that of -init-db (make just a footnote of it, to avoid intimidating 
>   readers).

I'm ignoring this for now.  We can add it later if someone says they've
run into it.  (But honestly it's partly just laziness on my part--no
objection if you want to make the patch.)

It's too bad about that option-name conflict.  It'd be nice just to be
able to do the whole thing with one clone commandline.  And it'd also
make sense to allow clone and init-db to share commandline options where
it made sense.

> - By far the easiest method to import from cvs is to go to a checked out
>   _CVS_ working directory, and just say "git cvsimport".

Neat, I didn't know about that.  Done.  I left the "-C" in there on the
assumption they often won't want to drop the result into the CVS working
directory.

Also did some miscellaneous cleanup.

--b.

commit 48ec79a74d0daa134b677ed5458beb873aa06e9a
Author: J. Bruce Fields <bfields@citi.umich.edu>
Date:   Thu Dec 7 12:38:09 2006 -0500

    Documentation: simpler shared repo creation, miscellaneous cleanup
    
    Create the shared repo with init-db --shared, fetch, and manual extraction
    of .git directory, instead of using clone --bare.
    
    Suggest running git-cvsimport from cvs working directory, more convenient
    thatn providing all the CVS information on the commandline.
    
    Fix a couple mispellings, add a couple manpage links.
    
    Thanks to Johannes Schindelin.
    
    Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
index 773fc99..4fab0d7 100644
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -43,8 +43,8 @@ Pull: refs/heads/master:refs/remotes/origin/master
 ------------
 ================================
 
-You can update the shared repository with your changes by first commiting
-your changes, and then using:
+You can update the shared repository with your changes by first committing
+your changes, and then using the gitlink:git-push[1] command:
 
 ------------------------------------------------
 $ git push origin master
@@ -76,11 +76,23 @@ possibly created from scratch or from a tarball (see the
 link:tutorial.html[tutorial]), or imported from an already existing CVS
 repository (see the next section).
 
-If your project's working directory is /home/alice/myproject, you can
-create a shared repository at /pub/repo.git with:
+Assume your existing repo is at /home/alice/myproject.  Create a temporary
+empty shared repository and fetch your project into it:
 
 ------------------------------------------------
-$ git clone -bare /home/alice/myproject /pub/repo.git
+$ mkdir /pub/temporary
+$ cd /pub/temporary
+$ git init-db --shared
+$ git fetch /home/alice/myproject master:master
+------------------------------------------------
+
+Then create a "bare" repository at /pub/repo.git by just moving the contents of
+the .git directory there.  The temporary repository can then be discarded.
+
+------------------------------------------------
+$ mv .git /pub/repo.git
+$ cd ..
+$ rm -rf temporary
 ------------------------------------------------
 
 Next, give every team member read/write access to this repository.  One
@@ -107,15 +119,15 @@ Importing a CVS archive
 
 First, install version 2.1 or higher of cvsps from
 link:http://www.cobite.com/cvsps/[http://www.cobite.com/cvsps/] and make
-sure it is in your path.  The magic command line is then
+sure it is in your path.  Then cd to a checked out CVS working directory
+of the project you are interested in and run gitlink:git-cvsimport[1]:
 
 -------------------------------------------
-$ git cvsimport -v -d <cvsroot> -C <destination> <module>
+$ git cvsimport -C <destination>
 -------------------------------------------
 
 This puts a git archive of the named CVS module in the directory
-<destination>, which will be created if necessary.  The -v option makes
-the conversion script very chatty.
+<destination>, which will be created if necessary.
 
 The import checks out from CVS every revision of every file.  Reportedly

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-07 17:43                         ` J. Bruce Fields
@ 2006-12-07 17:50                           ` Johannes Schindelin
  2006-12-08  3:34                             ` J. Bruce Fields
  0 siblings, 1 reply; 38+ messages in thread
From: Johannes Schindelin @ 2006-12-07 17:50 UTC (permalink / raw
  To: J. Bruce Fields; +Cc: Junio C Hamano, git

Hi,

On Thu, 7 Dec 2006, J. Bruce Fields wrote:

> +$ mkdir /pub/temporary
> +$ cd /pub/temporary
> +$ git init-db --shared
> +$ git fetch /home/alice/myproject master:master

Even easier:

$ mkdir /pub/my-repo.git
$ cd /pub/my-repo.git
$ git --bare init-db --shared
$ git --bare fetch /home/alice/myproject master:master

(Totally untested, of course.)

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-07 17:50                           ` Johannes Schindelin
@ 2006-12-08  3:34                             ` J. Bruce Fields
  2006-12-08  7:25                               ` Junio C Hamano
  0 siblings, 1 reply; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-08  3:34 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

On Thu, Dec 07, 2006 at 06:50:50PM +0100, Johannes Schindelin wrote:
> Even easier:
> 
> $ mkdir /pub/my-repo.git
> $ cd /pub/my-repo.git
> $ git --bare init-db --shared
> $ git --bare fetch /home/alice/myproject master:master
> 
> (Totally untested, of course.)

Of course--for some reason I didn't think of doing init-db with --bare.
Thanks again.

--b.

From 22e5bdd9de398f29dfb11125a0921bb4529e2ab7 Mon Sep 17 00:00:00 2001
From: J. Bruce Fields <bfields@citi.umich.edu>
Date: Thu, 7 Dec 2006 22:32:28 -0500
Subject: [PATCH] Documentation: simpler shared repository creation

Take Johannes Schindelin's suggestion for a further simplification of the
shared repository creation using git --bare init-db --shared.

Also fix a mistake from the previous patch: I forgot to remove the manual setup
which the --shared does for us.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
 Documentation/cvs-migration.txt |   27 ++++++++-------------------
 1 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
index 4fab0d7..20c5719 100644
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -76,23 +76,15 @@ possibly created from scratch or from a tarball (see the
 link:tutorial.html[tutorial]), or imported from an already existing CVS
 repository (see the next section).
 
-Assume your existing repo is at /home/alice/myproject.  Create a temporary
-empty shared repository and fetch your project into it:
+Assume your existing repo is at /home/alice/myproject.  Create a new "bare"
+repository (a repository without a working tree) and fetch your project into
+it:
 
 ------------------------------------------------
-$ mkdir /pub/temporary
-$ cd /pub/temporary
-$ git init-db --shared
-$ git fetch /home/alice/myproject master:master
-------------------------------------------------
-
-Then create a "bare" repository at /pub/repo.git by just moving the contents of
-the .git directory there.  The temporary repository can then be discarded.
-
-------------------------------------------------
-$ mv .git /pub/repo.git
-$ cd ..
-$ rm -rf temporary
+$ mkdir /pub/my-repo.git
+$ cd /pub/my-repo.git
+$ git --bare init-db --shared
+$ git --bare fetch /home/alice/myproject master:master
 ------------------------------------------------
 
 Next, give every team member read/write access to this repository.  One
@@ -105,10 +97,7 @@ Put all the committers in the same group, and make the repository
 writable by that group:
 
 ------------------------------------------------
-$ cd /pub
-$ chgrp -R $group repo.git
-$ find repo.git -mindepth 1 -type d |xargs chmod ug+rwx,g+s
-$ GIT_DIR=repo.git git repo-config core.sharedrepository true
+$ chgrp -R $group /pub/my-repo.git
 ------------------------------------------------
 
 Make sure committers have a umask of at most 027, so that the directories
-- 
1.4.4.1.GIT

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-08  3:34                             ` J. Bruce Fields
@ 2006-12-08  7:25                               ` Junio C Hamano
  2006-12-09  3:58                                 ` J. Bruce Fields
  0 siblings, 1 reply; 38+ messages in thread
From: Junio C Hamano @ 2006-12-08  7:25 UTC (permalink / raw
  To: J. Bruce Fields; +Cc: git

"J. Bruce Fields" <bfields@fieldses.org> writes:

> From 22e5bdd9de398f29dfb11125a0921bb4529e2ab7 Mon Sep 17 00:00:00 2001
> From: J. Bruce Fields <bfields@citi.umich.edu>
> Date: Thu, 7 Dec 2006 22:32:28 -0500
> Subject: [PATCH] Documentation: simpler shared repository creation
>
> Take Johannes Schindelin's suggestion for a further simplification of the
> shared repository creation using git --bare init-db --shared.
>
> Also fix a mistake from the previous patch: I forgot to remove the manual setup
> which the --shared does for us.
>
> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
> ---
>  Documentation/cvs-migration.txt |   27 ++++++++-------------------
>  1 files changed, 8 insertions(+), 19 deletions(-)
>
> diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
> index 4fab0d7..20c5719 100644

Well, this does not apply at all, as I do not have a commit with
4fab0d7 blob and already applied the reordering patch from you.
Could you fix up and send again after I push out the latest?  I
could try to coax into the documentation, but since I am not
even a CVS migrant myself and am known to be very bad at
documentation, I _really_ don't think you want me to do so.

;-)

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH] Documentation: reorganize cvs-migration.txt
  2006-12-08  7:25                               ` Junio C Hamano
@ 2006-12-09  3:58                                 ` J. Bruce Fields
  0 siblings, 0 replies; 38+ messages in thread
From: J. Bruce Fields @ 2006-12-09  3:58 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git

On Thu, Dec 07, 2006 at 11:25:17PM -0800, Junio C Hamano wrote:
> Well, this does not apply at all, as I do not have a commit with
> 4fab0d7 blob and already applied the reordering patch from you.

OK, sorry for the confusion.

> Could you fix up and send again after I push out the latest?

Definitely.  Is this better?

--b.

Documentation: simpler shared repository creation

Take Johannes Schindelin's suggestions for a further simplification of
the shared repository creation using git --bare init-db --shared, and
for a simplified cvsimport using an existing CVS working directory.

Also insert more man page references.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

 cvs-migration.txt |   27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

---

diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
index 47846bd..b657f45 100644
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -43,8 +43,8 @@ Pull: refs/heads/master:refs/remotes/origin/master
 ------------
 ================================
 
-You can update the shared repository with your changes by first commiting
-your changes, and then using:
+You can update the shared repository with your changes by first committing
+your changes, and then using the gitlink:git-push[1] command:
 
 ------------------------------------------------
 $ git push origin master
@@ -76,11 +76,15 @@ possibly created from scratch or from a tarball (see the
 link:tutorial.html[tutorial]), or imported from an already existing CVS
 repository (see the next section).
 
-If your project's working directory is /home/alice/myproject, you can
-create a shared repository at /pub/repo.git with:
+Assume your existing repo is at /home/alice/myproject.  Create a new "bare"
+repository (a repository without a working tree) and fetch your project into
+it:
 
 ------------------------------------------------
-$ git clone -bare /home/alice/myproject /pub/repo.git
+$ mkdir /pub/my-repo.git
+$ cd /pub/my-repo.git
+$ git --bare init-db --shared
+$ git --bare fetch /home/alice/myproject master:master
 ------------------------------------------------
 
 Next, give every team member read/write access to this repository.  One
@@ -93,10 +97,7 @@ Put all the committers in the same group, and make the repository
 writable by that group:
 
 ------------------------------------------------
-$ cd /pub
-$ chgrp -R $group repo.git
-$ find repo.git -mindepth 1 -type d |xargs chmod ug+rwx,g+s
-$ GIT_DIR=repo.git git repo-config core.sharedrepository true
+$ chgrp -R $group /pub/my-repo.git
 ------------------------------------------------
 
 Make sure committers have a umask of at most 027, so that the directories
@@ -107,15 +108,15 @@ Importing a CVS archive
 
 First, install version 2.1 or higher of cvsps from
 link:http://www.cobite.com/cvsps/[http://www.cobite.com/cvsps/] and make
-sure it is in your path.  The magic command line is then
+sure it is in your path.  Then cd to a checked out CVS working directory
+of the project you are interested in and run gitlink:git-cvsimport[1]:
 
 -------------------------------------------
-$ git cvsimport -v -d <cvsroot> -C <destination> <module>
+$ git cvsimport -C <destination>
 -------------------------------------------
 
 This puts a git archive of the named CVS module in the directory
-<destination>, which will be created if necessary.  The -v option makes
-the conversion script very chatty.
+<destination>, which will be created if necessary.
 
 The import checks out from CVS every revision of every file.  Reportedly

^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2006-12-09  3:58 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4574AC9E.3040506@gmail.com>
     [not found] ` <4574BF70.8070100@lilypond.org>
2006-12-06  0:41   ` git newbie problems Graham Percival
2006-12-06  1:23     ` Jakub Narebski
2006-12-06  9:39       ` Han-Wen Nienhuys
2006-12-06 10:17         ` Jakub Narebski
2006-12-06 10:21           ` Han-Wen Nienhuys
2006-12-06 10:42             ` Johannes Schindelin
2006-12-06  1:35     ` Junio C Hamano
2006-12-06 22:19       ` Daniel Barkalow
2006-12-06  1:52     ` Tom Prince
     [not found]     ` <el5608$952$2@sea.gmane.org>
2006-12-06  8:01       ` Graham Percival
     [not found]   ` <45760545.2010801@gmail.com>
     [not found]     ` <Pine.LNX.4.63.0612060053400.28348@wbgn013.biozentrum.uni-wuerzburg.de>
     [not found]       ` <45761451.8020006@gmail.com>
     [not found]         ` <Pine.LNX.4.63.0612060157020.28348@wbgn013.biozentrum.uni-wuerzburg.de>
2006-12-06  9:55           ` git patch Han-Wen Nienhuys
2006-12-06 10:00             ` Junio C Hamano
2006-12-06 10:22             ` Jakub Narebski
     [not found]             ` <Pine.LNX.4.63.0612061105220.28348@wbgn013.biozentrum.uni-wuerzburg.de>
     [not found]               ` <457698E0.80207@lilypond.org>
     [not found]                 ` <Pine.LNX.4.63.0612061147540.28348@wbgn013.biozentrum.uni-wuerzburg.de>
2006-12-06 11:27                   ` Han-Wen Nienhuys
     [not found]     ` <20061206.105251.144349770.wl@gnu.org>
2006-12-06 12:27       ` [PATCH] cvs-migration document: make the need for "push" more obvious Johannes Schindelin
2006-12-06 12:32         ` Jakub Narebski
2006-12-06 13:14           ` Johannes Schindelin
2006-12-06 13:27             ` Jakub Narebski
2006-12-06 13:32               ` New users, was " Johannes Schindelin
2006-12-06 14:52           ` J. Bruce Fields
2006-12-06 14:52         ` Han-Wen Nienhuys
2006-12-06 14:58           ` J. Bruce Fields
2006-12-06 15:05             ` Han-Wen Nienhuys
2006-12-06 15:16             ` Johannes Schindelin
2006-12-06 17:19               ` J. Bruce Fields
2006-12-06 17:24                 ` J. Bruce Fields
2006-12-06 17:44                   ` Junio C Hamano
2006-12-07  4:18                     ` [PATCH] Documentation: reorganize cvs-migration.txt J. Bruce Fields
2006-12-07  5:51                       ` Junio C Hamano
2006-12-07 15:21                         ` J. Bruce Fields
2006-12-07 14:28                       ` Johannes Schindelin
2006-12-07 17:43                         ` J. Bruce Fields
2006-12-07 17:50                           ` Johannes Schindelin
2006-12-08  3:34                             ` J. Bruce Fields
2006-12-08  7:25                               ` Junio C Hamano
2006-12-09  3:58                                 ` J. Bruce Fields
2006-12-06 21:02                   ` [PATCH] cvs-migration document: make the need for "push" more obvious Graham Percival
2006-12-06 21:45                     ` J. Bruce Fields

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).