Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
https://docs.google.com/document/d/1plu1PjGjMTpQzmX18Vd4PY17lDGELxg_kCJQ... is a starting point.
Doc can also be used by new drupal contributors.
Comment | File | Size | Author |
---|---|---|---|
#14 | EclipseNewProject.png | 70.34 KB | jhodgdon |
Comments
Comment #1
jhodgdonThis needs a bit of polishing and editing, but it has some good information that we need to get into the Handbook. Audience is current Eclipse/CVS users who contribute to Drupal core or contrib project, and need to migrate to git.
Not sure yet where it belongs.
Comment #2
marvil07 CreditAttribution: marvil07 commentedThe target could be at git handbook page for egit ;-).
Comment #3
jhodgdongood idea, thanks!
Comment #4
aspilicious CreditAttribution: aspilicious commentedThis document also has som usefull information.
http://goldapplesoftware.ca/blog/2010-10/using-eclipse-and-egit-drupal-d...
Someone left a comment about it under the EGit handbook page.
We also have to avoid linking to cvs specific docs.
Or aren't we going to remove those after the migration?
Comment #5
jhodgdonYeah, that's a good question. A lot of our CVS-specific docs have information that won't be changed in it (like how to set up a project). We'll have to comb through and figure out what documentation we need to keep.
Is there a tag for git migration that we should be adding to this issue? There's a LOT of doc that needs to be fixed up, extracted, or archived...
Comment #6
jhodgdontagging
Comment #7
jhodgdontagging again
Comment #8
eliza411 CreditAttribution: eliza411 commentedBased on conversation in irc with jhodgdon:
Anything related to git that can be completed before deployment should be tagged "git phase 2"
Anything that will need changing as soon as possible after deployment should be tagged "git deployment"
All should be tagged as "developer"
For items tagged "git deployment" the plan is:
(a) create temporary child page with CVS information replaced with git.
(b) at migration time, move the child page up in the hierarchy, and move the original parent page into the Archive book (where it will get unpublished sooner or later).
I'm not sure if we need a plain git tag or not.
Comment #9
aspilicious CreditAttribution: aspilicious commentedI would like to edit this page already. http://drupal.org/node/75242
I would like to place this just beneath http://drupal.org/node/75242#CVS.
After the git migration I would delete the cvs part :)
NEEDS review :)
---------------------------------------------------------------------------------------------------------------------------
EGIT(plug-in) ==> LINK: http://www.eclipse.org/egit/
This is a plug-in for working with GIT systems from within an Eclipse IDE. This plug-in generally is NOT included in the core Eclipse IDE installation. But you can easily install it by following these (==> link to http://www.banym.de/projects/eclipse/install-egit-plugin-for-eclipse or copy these instructions into a handbook page) instructions.
The following settings ensure that if you upload files to Drupal.org or create patches to upload, the uploads are in the standardized format (UTF-8, Unix line endings, and CVS -kkv
mode).
Also see http://drupal.org/node/901350: Eclipse EGIT plug-in (all platforms)
Make sure the file encoding and characters are Unix friendly so that any code and be committed back in to the Drupal CVS:
For version ?: Under Window -> Preferences (Eclipse
-> Preferences on Mac) menu:
Expand the left-hand menu to General -> Workspace. Set Text file encoding to UTF-8. Set New text file line delimiter to Unix.
Optional: There is also the possibilty to change your GIT settings. (for example choose the default directory where to import your git projects)
Expand the left-hand menu to Team -> GIT
Back to Top
Comment #10
aspilicious CreditAttribution: aspilicious commentedFrom twitter:
Comment #11
rfayI don't really see managing specific tools like this (Eclipse) as being part of the git migration. I'd like to untag this from the migration. I'm all in favor of offbeat things like this being handled, but I don't think it's critical path.
Note: I am also an Eclipse user. However, egit does not work very well in the context of nested projects, as most people do with Eclipse.
Comment #12
jhodgdonHaving tried and failed to add a Drupal project as an Eclipse project today (until aspilicious walked me through it in IRC), I think that having a page in the Git docs for how to do this would be helpful.
I'm not sure the Google doc referenced here is the right doc... I was able to follow http://wiki.eclipse.org/EGit/User_Guide#Starting_from_existing_Git_Repos... OK (and I don't think we need to reproduce it on d.o), but there was one glitch that aspilicious helped me with. If you use the New Project wizard to set up the project, the pull/import does not work. You need to select "General project" for it to work.
Anyway. I might see about adding a page about using Eclipse to the git docs, if someone else doesn't get to it first.
Comment #13
jhodgdonOne note: after setting a project up as a "general" project, you can (outside of eclipse) edit the .project file to make it into a PHP project (assuming you have the PDT installed). I'll work up some instructions, even though it is a hack - if you want to debug and have the other PHP project features, I think you need the project to be a PHP project.
And furthermore I will also say that I didn't have any success in first creating a PHP project and then using the Share Project command in Eclipse to attach it to git.
Comment #14
jhodgdonOh, I figured out how to do this. Here is a brief outline of what I think should go into the page on d.o git with Eclipse. As usual, we don't really want to duplicate official Eclipse documentation -- just point out where it is and how it relates to Drupal.
a) After installing Eclipse, install the PDT (PHP Development Tools) package and the EGit (Eclipse Git) package. There are guides on how to install them on their respective project pages: http://www.eclipse.org/pdt/ and http://www.eclipse.org/egit/.
b) Make a directory/folder on your computer to hold your Git repositories.
c) In Eclipse, find the Git settings (under Window / Preferences / Team / Git -- may be Edit / Preferences or Edit / Preferences on some platforms). Tell Eclipse where your Git repository is on the main Git screen. You can also set up your user name and email address on the Git / Configuration screen, by doing "New Entry". See http://drupal.org/node/1022156 (Identifying yourself to Git) for more information on which config entries you need to set up.
d) Also in the preferences under General / Workspace, set your default text file encoding to UTF-8, and the default line endings to Unix.
e) To import a Drupal project using Git into your Eclipse workspace, follow the general EGit instructions: http://wiki.eclipse.org/EGit/User_Guide#Starting_from_existing_Git_Repos...
- The repository location to use when you click "Clone" in the first step is: http://git.drupal.org/project/[name].git, where [name] is the name of the project. For instance, to import the Drupal project, the URL is http://git.drupal.org/project/drupal.git, and to import the Admin Menu project, the URL is http://git.drupal.org/project/admin_menu.git. If you are importing the Drupal project, you may want to choose only a subset of the branches, rather than all of them, to save time (assuming you don't need access to for instance Drupal 4.7).
- Once you have cloned the repository that you need and selected it, choose "Use the New Project Wizard" when you get to the screen that asks what wizard to use.
- On the next screen, choose "PHP Project".
- On the next screen, choose Create Project from Existing Source, and find the Git repository you just cloned (see attached screen shot).
- Click Finish, and your workspace should be set up.
f) I think we might want to include other sections on this page on how to do the common operations that are explained in http://drupal.org/node/1054616 (patch contrib workflow) and other Git doc pages? As I haven't gotten that far yet, I am not sure what to put on them... Thoughts?
Comment #15
jhodgdonRE #14 - Some other useful config items for (c) -
- General / Content Types - add .module, .install, and .test to the file extensions recognized to be text/PHP, and .info to the file extensions recognized to be plain text.
Comment #16
aspilicious CreditAttribution: aspilicious commentedNice jhodgdon ;)!
Comment #17
jhodgdonI was wondering where this should go, and after some digging, I found: http://drupal.org/node/777182 (GUI tools in the Git docs section). I think maybe this section needs to be placed at the upper level of the Git handbook so it can be found? But meanwhile, I added a child page and put the information above in there. It's a start at least...
http://drupal.org/node/1077484
Needs a review, and needs information on how to import a project for read/write access, make patches, and other Drupal/Git workflow tasks.
Comment #18
aspilicious CreditAttribution: aspilicious commented- I set the width of the image to 600px.
- Read write acces:
==> follow the ssh key steps written in the other git handbook section
==> change git protocol to ssh while cloning in eclipse
- Make patches
==> easiest workflow
- reset HARD to a branch where you would like to patch
- patch your files
- do a commit
- go to team=> show in history
- right click on your commit => create patch finish
******
What if you would like to edit your patch?
- Reset (mixed) to the branch you like to patch. Mixed leaves the changes you made intact. Kind of a revert patch.
- Make some changes
- Commit again
- Create new patch
******
==> pro workflow (for bigger patches)
- Create a new branch based on an existing one, be sure its a tracked branch (I think EGit does this by default)
- Fix stuff, commit, fix stuff, commit, fix stuff, ...
- After you're done, rebase your branch onto the original branch
**************
Why need branches be tracked? when you fetch a newer version of a branch from the server tracked branches based on that branch will be updated.
**************
// There is a section about patch workflows somewhere written by rfay
Comment #19
jhodgdonThanks for those outlines! I will test them as I have time (and the need for the processes), and add them to the page. Probably a table of contents at the top of the page would be helpful too, once there are multiple sections in the page.
Comment #20
aspilicious CreditAttribution: aspilicious commentedI thought there was some agreement about subpaging those gui tools
workflow for patcher
workflow for maintainers
and something else
Comment #21
jhodgdonWell, I don't know about that... let's at least get the information out there and then we can get it in the right place. Or if you figure out where it should go before I put the info out, then I'll put it in the right place...
Anyway, I needed to make a patch for a contrib module today, so I just added a section about how to make a patch, based on #18 (which worked for me).
http://drupal.org/node/1077484#patching
Also added a table of contents at the top of the page...
Comment #22
jhodgdonAfter some Git tutorials at DrupalCon, I now think the patching section I added recently should be revised to start with making a branch, as in the non-Eclipse git workflow that it is supposed to mirror.
Comment #23
eliza411 CreditAttribution: eliza411 commentedI'm not sure how http://drupal.org/node/75242 related to the Eclipse updates, but it's one of the last links tagged in the 'git deployment' sets for update. Perhaps while you all are working on this you could take a look at what to do with it?
Comment #24
jhodgdonMy thought on what to do with these pages:
a) 1077484 (the page we've been working on here) should link to 75242 (general Eclipse dev tool page referenced in #23). And vice versa.
b) The CVS section of 75242 should be completely removed.
c) The section at the top of 1077484 that covers Eclipse setup should be moved to 75242 instead and replaced with a link to 1077484.
d) Anything referencing patch making or other workflows in Eclipse that is in 75242 should be removed and replaced with a link to 1077484.
#22 still needs to be addressed too.
Comment #25
eliza411 CreditAttribution: eliza411 commentedMy mission today is getting the old CVS references out, so I completed b) and d)
As far as patching was concerned, there was just a general reference to be sure Eclipse was configured to roll and apply patches. It seemed clearer to remove that until #22 is done.
Comment #26
aenw CreditAttribution: aenw commented@jhodgdon: great work on http://drupal.org/node/1077484! just what I needed, right when I needed it. Kudos!
Back in #9, before this was expanded to a separate page, aspilicious talked about putting info into Configuring Eclipse (#75242).
I'd like to put a note in there now where the CVS info was. How about something simple like:
If someone new comes to the Configuring Eclipse page, I don't want to leave them without any information on d.o. + version control + Eclipse.
I'm just jumping into this (git documentation), and have tried to read thru the issue queue to understand the priorities, etc. So I'm not totally clear on whether we should wait to change or not. (I do get that it's not on the critical path right now.)
Comment #27
jhodgdonCross linking added as per comments #26 and #24.
Remaining items to be done on http://drupal.org/node/1077484 as far as I can tell:
1) Comment #22 - revise the patching discussion to suggest making a branch before committing the code. Also add section from http://drupal.org/node/707484 on how to clear the patch after you're done.
2) Add section on applying patches, based http://drupal.org/node/1054616 adapted to Eclipse
3) Add section on feature branches from http://drupal.org/node/1054616 adapted to Eclipse
4) Add section for project maintainers from http://drupal.org/node/1059322 adapted to Eclipse
5) Anything else we haven't added yet from comment #18 above.
Note: I think that the "advanced" workflows that aspilicious added recently to http://drupal.org/node/1077484 at the bottom may cover some of these topics... I would prefer that we not put outlines in this note format on 1077484 until they are fleshed out a bit more, because off-hand I wasn't sure what those were for. Probably they should be moved back to this issue until they make more sense.
Comment #28
aspilicious CreditAttribution: aspilicious commentedI'm sorry for putting those not finished docs and workflows in the document. Probably they need to be taken out.
Comment #29
jhodgdonHere's the unfinished section, which has been removed from the page until it can be made into something a little more comprehensible:
Comment #30
jhodgdonRE comment #18 and #27 above - here's the only thing I think we need to add from #18:
******
What if you would like to edit your patch?
- Reset (mixed) to the branch you like to patch. Mixed leaves the changes you made intact. Kind of a revert patch.
- Make some changes
- Commit again
- Create new patch
******
So, the remaining to do items are:
1) Comment #22 - revise the patching discussion to suggest making a branch before committing the code as in http://drupal.org/node/1054616 (or add this as an alternative way to make a patch)
2) Add section from http://drupal.org/node/707484 on how to clear the patch after you're done.
3) Add section on applying patches, based http://drupal.org/node/1054616 adapted to Eclipse
4) Add section for project maintainers from http://drupal.org/node/1059322 adapted to Eclipse
5) Item above in this comment about what to do if you need to modify an existing patch (see if there is a workflow on 707484 or 1054616 about this?)
6) What are the workflows in comment #29 for, and are they covered by these to dos or not? If not, they should be added too.
Comment #31
jhodgdonI just added stub sections to http://drupal.org/node/1077484 for all of the things I think are missing, and am working on them today. I'll try to remember to un-assign this when I run out of steam, but if you come by in a few days and want to work on this, you can probably assume I'm not working on it actively and assign this to yourself instead (whoever you are). :)
Comment #32
jhodgdonI've added a few things... remaining To Dos are marked "TODO" in http://drupal.org/node/1077484
Some questions I have:
a) Rebase - can this be done in EGit, and if so, how? I'm looking at http://drupal.org/node/1054616 and not sure how to do the rebase. Maybe the "Fetch from upstream" dialogs handle this, but I am not sure?
I guess that's it for now... I'm still editing...
Comment #33
jhodgdonaspilicious answered the rebasing question on IRC, so that has been updated. There are still some TODO items in http://drupal.org/node/1077484 in the patch workflows section, but not too many. Getting closer!
Comment #34
jhodgdonI think I'm done editing that page for this session... if someone else wants to write the few remaining patch sections and/or review what's there, that would be lovely.
Comment #35
aspilicious CreditAttribution: aspilicious commentedI'm not 100% sure we are on the same track with this...
Step 1: fetch from repository ==> all the tracked branches get updated
Step 2: rebase ==> your commits in the feature branch will be *moved* on top of the main branch, after this operation your feature branch is pointing to the last commit. And your master branch is pointing to the last commit fetched upstream (see examples in egit user guide)
Maybe you mean the same but I wasn't sure...
AND
Reverting after creating a patch:
"go to the repository viewer" ==> "search the branch you were working/did your commit on" ==> "right click, reset hard" ==> "fetch from upstream"
Comment #36
aenw CreditAttribution: aenw commentedI am in agreement with aspilicious: You want to make sure that you have the most current snapshot of what is in the d.o. repo before you apply and roll your patch. You should use
fetch
for that, commit your patch, thenrebase
. One of the main effects ofrebase
is that it will 'flatten' the merge history. You should do that before you commit your patch, but you may not want toreabase
until then because you may want to keep your local history of changes 'unflattened' in case you run into trouble.See step #3 under Creating patches via feature branch on the More Advanced Patch Contributor Guide.
You have the steps correct, but then the paragraph on Rebasing doesn't quite make sense.
Sometimes between the time when you start working on a patch and when you are ready to submit your patch to review, the main branch you based your patch on has been updated, because someone committed changes to it. If this happens, you need to "rebase" before creating your patch.
I would remove the "If this happens...." sentence because (a) you always want to do a fresh fetch so that you have the most current version of the code and are sure to incorporate any changes that have been commited on d.o, and (b) the command you need to use is "fetch" (or perhaps "pull"), not rebase.
Rebasing means that you will basically apply the changes from the main branch into your local branch, so you will now be basing your patch off the current state of the main branch, instead of off what it was when you started work.
Well, um, not exactly. I really think you want to talk about "fetching," not "rebasing."
So how about this:
OK -- those last sentences are a bit repetitively redundant. Perhaps someone can tighten them up.
Comment #37
aspilicious CreditAttribution: aspilicious commentedOk, note for jhodgdon:
Egit formatted patches need an aditional step when applying.
See screenshot:
http://img339.imageshack.us/img339/491/eclipseegitpatches.png
Comment #38
jhodgdonI believe I've addressed #35, 36, 37 -- if you could review those sections, that would be helpful.
There are also still several TODO sections to be filled in.
Comment #39
hansfn CreditAttribution: hansfn commentedIs this still relevant? I can't imagine anyone migrating from cvs to git (in Eclipse) now.
I'm closing the issue as outdated. If there is still something that should be added to out Git documentation, it's maybe better to create a new issue?