Github and SmartGit

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Github and SmartGit

#1 Post by BarryK »

I thought that I would start a thread, in case anyone else is interested in this.

My knowledge of git is rudimentary, and I have read other posts in this forum from people who would like to contribute to WoofCE but find git daunting.

There are GUIs for git, and SmartGit seems to be one of the best. Closed-source commercial, free for non-commercial projects.

I searched, only one mention of SmartGit by mavrothal in this forum:
http://murga-linux.com/puppy/viewtopic. ... 101#868101

SmartGit is easy to install, and unlike some others I tried, runs without any apparent problems. I made some notes on installing, with links, on my blog:
http://barryk.org/news/?viewDetailed=00355

It was easy to setup and clone a github repository. In my case, I cloned Sabotage, which I am currently playing with:
http://barryk.org/news/?viewDetailed=00354

After that, it seems I will need to create a local branch, make some changes, and eventually get my changes merged back into the remote master branch.

Exactly the same situation applies to another repo such as WoofCE.

These steps are what we could discuss, if anyone is interested.

And maybe one of our git maestros can contribute, so that this thread can be become a super-easy-to-contribute-to-woof*-guide
[url]https://bkhome.org/news/[/url]

april

#2 Post by april »

Partner tried putting a comment on your home page but could not find it again .

Comment was " I notice Open Office and DeadBeef put their installations into /opt and I tend to put my stuff like Arduino and Brother files in there too . I can find them when I want them then"

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#3 Post by BarryK »

I am doing another install of SmartGit, taking snapshots as I go.
Hope to take it right through to cloning woofCE.

Step1: installation
----------------------------
Download: http://www.syntevo.com/smartgit/
Download: http://www.oracle.com/technetwork/java/ ... 80261.html

expand jre-7u80-linux-x64.tar.gz and smartgit-linux-7_1_3.tar.gz

# tar -xf jre-7u80-linux-x64.tar.gz
# tar -xf smartgit-linux-7_1_3.tar.gz

Create /root/.smartgit/smartgit.vmoptions
with one line:
jre=<path>/jre1.7.0_80

# cd smartgit
# ./bin/smartgit.sh
...launches GUI.

Step 2
----------
What will follow, snapshots:
Attachments
step4-ssh-client.png
(10.37 KiB) Downloaded 405 times
step3-user-information.png
(9.72 KiB) Downloaded 393 times
step2-license.png
(13.84 KiB) Downloaded 383 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#4 Post by BarryK »

Why didn't those images display inline?

Step 5: hosting providers
---------------------------------------
I chose "github", and unticked the checkboxes.
The next thing to do is click the 'Generate API token' button.
Attachments
step5-hosting-provider.png
(13.45 KiB) Downloaded 370 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#5 Post by BarryK »

Step5b: master password for API token
-------------------------------------------------------------
Attachments
step5b-master-password-for-api-token.png
(11.2 KiB) Downloaded 703 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#6 Post by BarryK »

Step5c: authenticate token at github
----------------------------------------------------------
Attachments
step5c-authenticate-token.png
(10.7 KiB) Downloaded 376 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#7 Post by BarryK »

Step6: crash reports
--------------------------------
I suppose it is ok to leave the box ticked.
Attachments
step6-crash-reports.png
(13.33 KiB) Downloaded 350 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#8 Post by BarryK »

Step7: clone repo
----------------------------
SmartGit starts up, window pops up, choose radiobutton to clone a repo.
Attachments
step7-clone-repo.png
(6.49 KiB) Downloaded 716 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#9 Post by BarryK »

Step7b: clone WoofCE
---------------------------------
Attachments
step7b-clone-woofce.png
(8.51 KiB) Downloaded 396 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#10 Post by BarryK »

Step7c: failure
----------------------
Why? Exact same steps worked OK for Sabotage on git.
Attachments
step7c-fail.png
(5.13 KiB) Downloaded 689 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#11 Post by BarryK »

This is the URL I used for Sabotage:

https://github.com/sabotage-linux/sabotage.git

This works, I was able to clone the repo.

I wonder. For the above steps, I did a complete new installation, running Quirky 8.0 and a different partition.
Maybe the authentication token clashed with the previous one?

If that is the case, then if you do a first install following my step, it should work.

Right now, I am back in Quirky April 7.2.1, where I have the first install of SmartGit, and it is working.

Running SmartGit, the original installation, I close Sabotage, choose to clone a new repo (Repository -> Clone...)

I inserted the url:
https://github.com/puppylinux-woof-CE/woof-CE.git

It asked for the Master Password (back when I created the authentication token), so do NOT FORGET IT.

Step7e: choose when to save cloned repo:
Attachments
step7e-save-cloned-woofce.png
(5.35 KiB) Downloaded 326 times
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#12 Post by BarryK »

Step8: open cloned woof-ce
-------------------------------------------
See snapshot, it doesn't make any sense to me.
I thought that I should see directories in the left pane, but there are none.
In Sabotage, I do see the directories. Hmmm.
Attachments
step8-woofce-opened.png
(26.63 KiB) Downloaded 380 times
[url]https://bkhome.org/news/[/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#13 Post by musher0 »

Hello Barry.

Thank you kindly for your illustrated tutorial.
I'm sure i'll find it handy someday.

TWYL.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#14 Post by BarryK »

I would like to report some success with using SmartGit.

After staring at the UI with considerable bafflement, and not knowing how to proceed, the next day I started doing a few things, and found the pieces of the jigsaw coming together.

Having cloned the Sabotage repository, I then created a branch, that I named "f2fs-tools-new-pkg", in the local repo.

Reason for this, is I want to contribute the f2fs-tools package, or rather the recipe for compiling it, to the Sabotage repository.
So, I created the branch to get it working, and after it is, I can merge 'f2fs-tools-new-pkg' branch back into the local 'master' branch, then I can push it to the remote repo -- that's the theory anyway, I haven't got that far.

The local Sabotage repo is setup to be at /mnt/sdb5/projects/sabotage
In that directory, I made the changes required to introduce the new package f2fs-tools.
Then, looking at the SmartGit GUI, I saw that these new files showed up, marked as uncommitted, and I chose to commit them to the local f2fs-tools-new-pkg branch.

Having got through the initial confusion, using the GUI is becoming quite nice.

With Sabotage, for doing a native compile (the host system has the same CPU architecture as the target), the instructions are given here:
http://sabotage.tech/README.html

That is, create sabotage/config, with some variables to set, including path to the build-directory -- which I set as /mnt/sdb5/projects/sabotage_builddir
Then, in sabotage directory, run "./build-stage0"
Then, run "./enter-chroot"
Then run "./butch download stage1"
Then "./butch install stage1"

That last one compiles the packages in stage1, basic stuff like gcc, bison, m4, libz, kbd, musl.

Now, the thing is, what affect does all this activity have in the SmartGit GUI? Nothing, because the build is taking place outside the local repo.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#15 Post by BarryK »

OK, I have got to the point of creating a "pull request" at https://github.com/sabotage-linux/sabotage/pull/420

I did something wrong at the very start. I cloned https://github.com/sabotage-linux/sabotage, but I don't have "push" right to that repo. Therefore was unable to upload my local changes.

What I should have done at the very start, was fork https://github.com/sabotage-linux/sabotage, then clone my fork.
Then I have push right to my fork, so I was able to upload my changes.

Then, over at https://github.com/sabotage-linux/sabotage, I was able to do a "pull request", to merge my changes on my fork.

I have now made the pull request, and it will be up to rofl0r, the main guy at sabotage-linux/sabotage, to accept or reject my request.

I presume that the same principles apply to woof-CE. Fork it first, to your own account. Then clone it.
[url]https://bkhome.org/news/[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#16 Post by 01micko »

BarryK wrote:I presume that the same principles apply to woof-CE. Fork it first, to your own account. Then clone it.
Yep. Pretty much how git (not just GitHub) works in general. Although if not using a third party 'service' (such as GitHub or Bit-Bucket) it can get complex.
Puppy Linux Blog - contact me for access

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#17 Post by step »

With due respect, after the initial learning curve, I find using git commands from the shell easier than a GUI. Reasons:

1) If I want to undo an unwanted change the GUI is likely to make undoing the change harder rather than easier.
2) If I want to know how to do something a little bit more complex than the basic git operations, I need to look up the Internet - where advice and tutorials describe command-line git commands

If you're going to use github, their how-to's are pretty good too, especially when you need to know how to sync your local repo with the remote Github repo in unusual ways.

Specifically for browsing commit history and performing diff comparisons, I think a GUI-git-diff tool can be very useful. The standard git package provides gitk, and that's pretty good. I haven't searched for a better one, because I use vim with the vim-fugitive git plugin, which covers my needs.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#18 Post by jamesbond »

The standard git package provides gitk, and that's pretty good
Agreed. And I just found out about "git-gui", which is also part of the standard git package too. It also uses Tcl/Tk, and while gitk is mainly for repository browing; "git gui" is meant for actually doing things like commit, branching out, merging, etc. It is surprisingly functional :D

Like step, I prefer to use command line too, but to each his own, I suppose.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#19 Post by Karl Godt »

I dislike " new " things .


GITHUB is smart enough .


It needs some lion to push through some enhancements against a hyena as mavrothal .
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#20 Post by BarryK »

I am still enjoying using SmartGit. As I never used the commandline, beyond a simple "clone", I don't appreciate how better or worse it would be using just the CLI.

SmartGit really is clever, but I discovered a bug yesterday. When I edit a file, SmartGit automatically detects that and highlights it as "modified", or if I add a file, it gets highlighted and marked as "untracked". Then I can choose to commit them.

Anyway, the bug. I edited a file, in SmartGit there are two windows, one showing the earlier committed version, the other showing the actual file, with coloured areas to show the differences. Little arrows enable copying these different bits between the files, or deleting. Except that it doesn't work properly. I found that I really have to commit the whole file.

Then today, I got my nickers in a twist. There was a bug in recent commits that I had pulled from the remote repo, so I chose to "revert" them. It did, but oh dear, no way could I un-revert them.

Eventually, I did a checkout from an earlier revision, to a new local branch, that I named "master-2". Then I pulled later commits from the remote repo.

My lack of knowledge about git is partly to blame. But I wonder if I would have fared any better if I had been trying to do all of this from the CLI?

At least with the GUI, I was able to look around and discover how to fix my problem, didn't even need to go away and read up on arcane CLI operations :wink:
[url]https://bkhome.org/news/[/url]

Post Reply