How to submit patches?

Hi,

I’m really not a developer and subsequently unfamiliar with Github. My reading has led me to believe that I should really be cloning the Github project I wish to contribute to, instead of forking it. Is there possibly documentation or ideally ‘speed notes’ on the preferred way I should be submitting patches?

From what I’ve been able to scratch together thus far:

cd /home/user;
git clone https://github.com/vyos/vyatta-cfg-quagga vyos_vyatta-cfg-quagga;
cd vyos_vyatta-cfg-quagga;
pico .git/config;
  # Change URL to SSH so that public key authentication works, eg:
  url = ssh://git@github.com/vyos/vyatta-cfg-quagga.git

# Updating my local copy:
cd /home/user/vyos_vyatta-cfg-quagga;
git pull;

# Create a branch to contain commits
git checkout -b additional_frr_commands

# Switch between master and branches:
cd /home/user/vyos_vyatta-cfg-quagga;
git branch;           # -a shows all branches on the parent at Github
git checkout master;
git checkout additional_frr_commands;

# Create a commit:
cd /home/user/vyos_vyatta-cfg-quagga;
git checkout additional_frr_commands;
pico directory/new_file;
git status;
  git add directory/new_file;
git commit -s -m "New function to do something";

Questions:

  • How do I now submit these back to the project for review? I understand that I should create an item in Phabricator and reference this in the submission but what commands do I run to upload my branch to the relevant project?

Regards
David Herselman

Hi David,

At this point, Diffusion (the Phabricator source hosting module) is a read-only mirror that is only used to enable automatic linking of commits with tasks, and as a backup for the case things go seriously wrong with Github.

Right now you can attach a patch as a file to a Phabricator task. Since it’s an uncommon workflow, you should mention it prominently in the task that you’ve attached a patch.
The rest of the workflow is the same. You must reference the task number in the commit. It also must be a git patch (i.e. produced with git format-patch) that we can use with git am.

1 Like

Hi,

Hope the following are in order:
https://phabricator.vyos.net/T1973
https://phabricator.vyos.net/T1974

Regards
David Herselman

Thanks for contribution David!
you also can do pool requests to github repos as well
w usually mention task number in commit message for better tracking

Hi David,
I’ve merged all the patched you’ve attached to tasks, thanks for it!

However, I noticed that you in fact have created a pull request in DANOS. Now I wonder if I made things harder for you through misunderstanding. When people show me a git patch and ask how to submit it, it’s usually because they have some philosophical or political objections against Github (that’s not unwarranted, so I’m always open to alternative procedures).

Our standard contribution procedure is a pull request on Github, against the “current” branch. If you have nothing against Github, making pull requests can save you and us some time.

Many thanks, I’ll spend some time finding tutorials on how to create a pull request from a cloned project as I read somewhere that forking projects to create the basis of a pull request to be the wrong way to handle it.

Hi bbs2web, a forked project is the best way to send us a pull request. There is also https://docs.vyos.io/en/latest/contributing/development.html#submit-a-patch which describes the process and how to fork/send PullRequest.

Cheers,
Christian

1 Like