We talked in IRC last night about how, given that we're using 'git diff', most of the current patching process in Git instructions is unnecessary for basic changes. webchick, marvil07 and I worked on the following update. We weren't quite done, but I want to capture where we were when we quit for the night:

Creating a patch

For most improvements, use the following after making your changes:

git diff >  [description]-[issue-number]-[comment-number].patch

For more complex improvements that require adding/removing files, work over the course of multiple day , or collaboration with others, see the more advanced patch workflow

Note: we'll need to work on the advanced workflow at the same time we consider updating the instructions.

Comments

After a little more work, we're closer to:

Getting ready to create or apply patches:

If you have not already cloned the repository, follow the directions above for setting up this repository in your local environment. Be sure you are on the branch you wish to patch, then ensure it is up-to-date with the following command:

git pull origin %branchname

Creating a patch

For most improvements, use the following command after making your changes:

git diff >  [description]-[issue-number]-[comment-number].patch

For more complex improvements that require adding/removing files, work over the course of multiple days, or collaboration with others, see the advanced patch workflow.

Applying a patch

Download the patch to your working directory. Apply the patch with the following command:

git apply -v [patch.name]

To avoid accidentally including the patch file in future commits, remove it:

rm  [patch.name]

See Applying Patches for more detail.

When you're done: Reverting uncommited changes

Revert changes to a specific file:

git checkout [filename]

Revert changes to the whole working tree:

git reset --hard

Assigned:Unassigned» eliza411

We're going to go forward with this change as soon as the patch documentation is cleaned up as well.

Yep, works for me.

Maybe instead of [patch.name]
use [patchname.patch]

Just one comment from someone who is trying to follow the right path ;-)

The Git instructions for a project say the recommended naming is:

[description]-[issue-number]-[comment-number].patch

Whereas the Patch contributor guide says the issue number should be first:

[issue-number]-[description]-[comment-number].patch

IRC comment from ksenzee: "It's obviously easier to change the handbook than it is to change the git instructions, but personally I agree with the handbook." I think the issue number first is also a better idea, but don't have any idea what it would take to change the automatic "Git instrucitons".

Status:Active» Closed (duplicate)

Actually, I should elaborate as this is a clear request. There is no community consensus on the format and we're asked to change this on a regular basis, but not asked to change it to the same thing. What's in Git instructions represents the recommendation of the Git team. I run changes by rfay, webchick, and sdboyer at a minimum. If a g.d.o. discussion leads to a clear standard, I am happy to make the adjustment. Of course, that won't stop the docs from changing when people disagree.

Status:Closed (duplicate)» Active

Status:Active» Needs review
StatusFileSize
new22.83 KB

This month's update

Project:Git on Drupal.org» Project Git instructions
Version:» 6.x-1.x-dev

Moving to Project Git instructions

Status:Needs review» Needs work

I diffed that patch wrong. Working on re-rolling.

Status:Needs work» Needs review
StatusFileSize
new20.69 KB

This should be better. I also isolated the patch to this issue only.

StatusFileSize
new21.34 KB

Try this one more time. One set of instructions got missed.

I made the update to the database this morning.

Hi all. Thanks for all the hard work on Git and this module -- it's a life-saver for a Git n00b like me.

I'm sure these patch instructions will be useful when I start patching issues, but I noticed that some of the old instructions are gone.

For me (again, Git n00b), it was helpful to have instructions on how to commit my changes locally (git add -u, git commit -m) and "Tag for a stable release."

It's possible the old instructions were removed for a good reason I'm unaware of (probably better to work through the issue queue/patches...?). But if you do need to make a new release, the instructions for that were very helpful.

My two cents, and thanks again for all your hard work!

Aaargh. When I logged in to post my question, I began to have a sneaking suspicion I'd have different instructions when I went back to my project page logged in. Sure enough, there were the local commit and tag instructions.

Sorry for the false alarm!

Status:Needs review» Fixed

Marking fixed.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.