Next: Vanilla sources (no repo), Previous: Patches, Up: Patches [Contents][Index]
Firstly, if you can set up an accessible remote repo, please do so. You can see how easy it is in section See Setting up a publicly accessible repo. It will make things so much easier for everyone. We do understand that there may be some valid reasons why you can’t, and that is okay, this section still provides a valid workflow.
Before you do anything, we recommend that you run the
git-for-steve.sh
script which you’ll find in the contrib
directory. It will ensure that some basic git config settings are
correct, and set up your “for-steve” tracking branch.
Are you in the right place? You cloned the SXEmacs sources with
git clone http://git.sxemacs.org/sxemacs
.
Yes? OK, great, read on.
Your workflow should run something along these lines…
git pull
from your “for-steve” branch to sync up with the main
SXEmacs repo.
git checkout -b mybugfix
to create and checkout a new branch.
You can call it whatever you like, just as long as you know
what it’s about. (Yeah, we recommend that you do all your work on
branches and keep your master branch as pristine as possible).
git config commit.gpgSign true
1.
Depending on how you like to deal with change logs, and if the changes were small and trivial or detailed and large:
git commit -sam "Summary of changes"
For use with small quick
changes that don’t really warrant verbose logs to document them.
git commit -sa
This form will fire up an editor for you to
write your change logs in2.
git commit -saF mylogfile
Use this form for the times when you
have logged your changes as you went to the file mylogfile.
Please take note, that whichever commit command you use, to
always use the -s
option to add a Signed-off-by
entry to the log. This will indicate that you played some role in
getting the patch into the code base, and, perhaps more importantly,
you had permission to do so3.
For patches that you’re submitting to the main SXEmacs code base that have originated from somebody else (maybe you have a small team of sub-developers working for you), the Signed-off-by entry also indicates that you have reviewed, tested, and approved the patch. And also, the original author has permission to submit it.
git checkout for-steve
To flip back to your for-steve branch.
git merge mybugfix
To merge the changes from the
mybugfix branch into your for-steve branch.
At this point everything that was in the mybugfix branch is now
in your for-steve branch, so you no longer need it. You can safely delete
it with git branch -d mybugfix
.
Now if you have a publicly accessible repo, you should do:
git push myremote for-steve
To push the changes to your publicly
accessible repo, myremote.
If your repos is private, it is safe to skip the push and just advance to the next step.
At this point, your changes are ready for Steve to incorporate into the main SXEmacs code base. All you need to do is let him know, and you can easily do that with the following 2 git commands4:
git format-patch --add-header="X-Git-Repo: REPO-URL" \
--add-header="X-Git-Branch: for-steve" \
--subject-prefix="P-Req" --minimal --numbered -o DIR origin/master
git send-email \
--to="SXEmacs Patches <sxemacs-patches@sxemacs.org>" \
--from="$(git config user.name) <$(git config user.email)>" DIR
If you not have have a publicly accessible repository, the SXEmacs developers can’t pull in your changesets directly from you. Instead, once your patch hits the mailing list and is approved, it will have to be applied manually to the SXEmacs code base.
You could, in theory, use a post-commit hook, but I’d not recommend it. Think about the situation where you are working on something fairly big. You’d most likely commit several times before you have things ready for us.
If you have a publicly accessible repo, be sure to setup automation like in See Automation.
Already done for
you if you ran the git-for-steve.sh
script and it found your
key
You can set which editor to use
with git config --global core.editor my_fav_editor
. Steve has
his set to a shell function called edit which fires up gnuclient
if SXEmacs is running, or SXEmacs if not.
There might be licencing/copyright things to be aware of, especially in the case of working on SXEmacs either for your employer, or during your employer’s time.
The
git-for-steve.sh
contrib script will set a lot of these for you.
Next: Vanilla sources (no repo), Previous: Patches, Up: Patches [Contents][Index]