Some Questions on GIT
#1
Hello all,

I started with GIT to contribute my first patch to xbmc. I sucessfully created a fork, made my changes and did a commit and a push. Changes are on GITHUB, thats fine.
After some changes , I did further commits and pushes. Now I am not sure, how to create a patch file, which includes all my commits!

Secondly:

I have more independent ideas to support xbmc, and I understood, that a seperate patch for each patch/change is required. So, I really do not know, how to proceed, Do I have to create a new fork for every patch I like to commit or can I distinguish between different "implementations" within my fork?

Greetings!

Carsten!
___________________________________
No Backup, No Mercy
Reply
#2
thica Wrote:I started with GIT to contribute my first patch to xbmc. I sucessfully created a fork, made my changes and did a commit and a push. Changes are on GITHUB, thats fine.
After some changes , I did further commits and pushes. Now I am not sure, how to create a patch file, which includes all my commits!
The github way is to create a "Pull Request". There's a button for it on github when you're viewing your fork. You can specify the commit range if you don't want all the commits to be pulled and you can provide some description/explanation.

thica Wrote:I have more independent ideas to support xbmc, and I understood, that a seperate patch for each patch/change is required. So, I really do not know, how to proceed, Do I have to create a new fork for every patch I like to commit or can I distinguish between different "implementations" within my fork?

You only fork XBMC once but you should create a new branch (git checkout -b some-branch-name) for every feature. This way you can work on multiple features at once (as long as they do not require each other to work) and have multiple active pull requests. You should never do any work in your "master" branch but always work in some branch. The master branch is there to get the latest updates from xbmc/master without any conflicts. So everytime you wanna start working on a new feature, you update your master branch (git pull upstream master, but there's more in this subject on github's help) and then create a new branch from the latest state.

Hope this helps a bit.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
Hello,

Thanks, that seems to be helpful, will give it a try. For the master branch: Too late, i allready made my changes there :-(, I will follow your tips in the next version...
___________________________________
No Backup, No Mercy
Reply
#4
thica Wrote:Hello,

Thanks, that seems to be helpful, will give it a try. For the master branch: Too late, i allready made my changes there :-(, I will follow your tips in the next version...

You can still create a branch from your master which will have the exact same commits/changes as your master branch has. Then you can revert your master branch (git reset --hard HEAD~X where X is the number of commits you wanna go back) to a state where it matches xbmc's master.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
Hello,

tahnks for your support, was on holidays for a while so I started today...

What I have done: (dharmfanart is my branch)

Code:
git checkout -b dharmafanart
git checkout master
git reset --hard HEAD~5

I changed no source file so far.

What are the next steps to make sure, that only the "dharmafanart" branch is listed and how can (do I need it?) get a patch file to submit?

Seems, that I still did not got the concept of git....





Montellese Wrote:You can still create a branch from your master which will have the exact same commits/changes as your master branch has. Then you can revert your master branch (git reset --hard HEAD~X where X is the number of commits you wanna go back) to a state where it matches xbmc's master.
___________________________________
No Backup, No Mercy
Reply
#6
thica Wrote:
Code:
git checkout -b dharmafanart
git checkout master
git reset --hard HEAD~5
That looks alright to me.

thica Wrote:What are the next steps to make sure, that only the "dharmafanart" branch is listed and how can (do I need it?) get a patch file to submit?

So you should have all the changes you made in your dharmafanart branch now right? You can push that branch to your git repository on github by running
Code:
git checkout dharmafanart
git push origin dharmafanart
Once that is done you can head to your git repo on github, switch to your dharmafanart branch and press the "Pull Request" button. That should open a form which shows you the changes you made and also shows you a diff of all the changes you made in that branch. That Pull Request (PR) is sent to XBMC's git repo and someone will review your changes and give you feedback and if it's ok to go into XBMC's source code it will be pulled in.

Any other questions? Wink
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#7
To be very honest: As I have a copy of my changes, and I am very unsure that all this works, I would prefer a fresh restart with a new fork. It is possible to just delete the fork and create a new one with all the branches I would like to create and use?
___________________________________
No Backup, No Mercy
Reply
#8
Tip I got when I first started with git, the naming convention is usually that origin is upstream, i.e. xbmc mainline.

Forking kindof alters this somewhat but when you follow guides on git many times they refer origin as the mainline instead of your fork.

so for me I have origin as xbmc mainline and remote topfs2 as my fork, then I add other forks as other names and when we speak amongst all devs, origin always refer to mainline, which makes life easier Smile
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply

Logout Mark Read Team Forum Stats Members Help
Some Questions on GIT0