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.
Comment | File | Size | Author |
---|---|---|---|
#12 | basic_patch_workflow_only-1128070.patch | 21.34 KB | eliza411 |
#11 | basic_patch_workflow_only-1128070.patch | 20.69 KB | eliza411 |
#8 | basic_patching_only-1128070.patch | 22.83 KB | eliza411 |
Comments
Comment #1
eliza411 CreditAttribution: eliza411 commentedAfter 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:
Creating a patch
For most improvements, use the following command after making your changes:
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:
To avoid accidentally including the patch file in future commits, remove it:
See Applying Patches for more detail.
When you're done: Reverting uncommited changes
Revert changes to a specific file:
Revert changes to the whole working tree:
Comment #2
eliza411 CreditAttribution: eliza411 commentedWe're going to go forward with this change as soon as the patch documentation is cleaned up as well.
Comment #3
rfayYep, works for me.
Maybe instead of [patch.name]
use [patchname.patch]
Comment #4
eporama CreditAttribution: eporama commentedJust 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".
Comment #5
eliza411 CreditAttribution: eliza411 commentedSee #1072480: patch filename format bikeshed
Comment #6
eliza411 CreditAttribution: eliza411 commentedActually, 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.
Comment #7
eliza411 CreditAttribution: eliza411 commentedComment #8
eliza411 CreditAttribution: eliza411 commentedThis month's update
Comment #9
eliza411 CreditAttribution: eliza411 commentedMoving to Project Git instructions
Comment #10
eliza411 CreditAttribution: eliza411 commentedI diffed that patch wrong. Working on re-rolling.
Comment #11
eliza411 CreditAttribution: eliza411 commentedThis should be better. I also isolated the patch to this issue only.
Comment #12
eliza411 CreditAttribution: eliza411 commentedTry this one more time. One set of instructions got missed.
Comment #13
eliza411 CreditAttribution: eliza411 commentedI made the update to the database this morning.
Comment #14
jami CreditAttribution: jami commentedHi 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!
Comment #15
jami CreditAttribution: jami commentedAaargh. 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!
Comment #16
eliza411 CreditAttribution: eliza411 commentedMarking fixed.