Git tool
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Git tool
I recoded the Arch Git tool too (git commit 09e9c89). Now we have this:
Basically, you need:
1) the python-git package installed (we can see about this for windows later)
2) you must have a git repo on your computer already, and have the current file saved in it.
Then you just click menu Arch->Utilities->Git and this panel appears. There, you can:
- read the git log
- see the diff of a selected file
- commit selected files
- pull from a selected remote
- push to a selected remote
Of course this need more stuff (ability to start a new repo, create and switch branches, manage remotes etc - anyone interested in extending? ) but for a simple, one-branch workflow this works well already...
Basically, you need:
1) the python-git package installed (we can see about this for windows later)
2) you must have a git repo on your computer already, and have the current file saved in it.
Then you just click menu Arch->Utilities->Git and this panel appears. There, you can:
- read the git log
- see the diff of a selected file
- commit selected files
- pull from a selected remote
- push to a selected remote
Of course this need more stuff (ability to start a new repo, create and switch branches, manage remotes etc - anyone interested in extending? ) but for a simple, one-branch workflow this works well already...
Re: Git tool
It's been in the dev-snapshot bundle for a few weeks. Testing results welcome.yorik wrote:1) the python-git package installed (we can see about this for windows later)
"fight the good fight"
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Git tool
Hey, is this related to the "git like" question I had a few days/weeks ago ?
Re: Git tool
Looking good.
But i do have one question. Does the Git executable need to be installed or can GitPython do this by itself?
But i do have one question. Does the Git executable need to be installed or can GitPython do this by itself?
Re: Git tool
Why is this in Arch module and not Freecad standard (just workbench independend...)yorik wrote:Then you just click menu Arch->Utilities->Git and this panel appears. There, you can: ...
Re: Git tool
It was on my todo list for some time, but yeah, the more people talk about it...vejmarie wrote:Hey, is this related to the "git like" question I had a few days/weeks ago ?
I think gitpython uses the git executable under the hood, but I suppose it is included in windows... in linux the python-git package depends on the git package.triplus wrote:But i do have one question. Does the Git executable need to be installed or can GitPython do this by itself?
Basically I was still testing, and don't want to "pollute" the rest of FreeCAD while it's not finished. But you're right, at some point it should be migrated somewhere else.Jee-Bee wrote:Why is this in Arch module and not Freecad standard (just workbench independend...)
Re: Git tool
Only git-python is included in the win bundle. Windows users should install the git executable using the installer from here: https://git-scm.com/download/winyorik wrote:I think gitpython uses the git executable under the hood, but I suppose it is included in windows... in linux the python-git package depends on the git package.
"fight the good fight"
Re: Git tool
Does it say something when you type in the console:sgrogan wrote:Only git-python is included in the win bundle. Windows users should install the git executable using the installer from here: https://git-scm.com/download/win
Code: Select all
import git
If not, we could add a warning for the user...
Re: Git tool
A while back i investigated this a bit and i was under the impression Git executable is needed. The licence of Git therefore isn't ideal fit for FreeCAD licence policy. But this option is the only one if we want the best possible Git support.yorik wrote:I think gitpython uses the git executable under the hood, but I suppose it is included in windows... in linux the python-git package depends on the git package.triplus wrote:But i do have one question. Does the Git executable need to be installed or can GitPython do this by itself?
Alternative would be to use Dulwich and i guess porcelain API:
https://www.dulwich.io/apidocs/dulwich.porcelain.html
This approach would i guess always lack a bit against using "the real thing". But once it will have Apache licence i guess it could be packed as "FreeCAD module" and to be imported when needed for some FreeCAD Git related functionality? Anyway this are just some thoughts and lets wait and see what will the future bring.
Re: Git tool
In pseudo code if something like this would be possible in the future and available by default:
That would i guess make FreeCAD "git ready". And i do imagine some nice GUI dialogs would be made as a result to provide some useful features to FreeCAD users.
Code: Select all
import dulwich
dulwich.porcelain.clone("git url", target='UserAppData/Mod')