gitupper, basic dist-up via git

Submitted scripts and programs
Forum rules
Your own work only.
User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

gitupper, basic dist-up via git

Unread post by DebianJoe » Sun Sep 08, 2013 5:14 pm

killx has made it slightly more confusing to keep up with all of the git-based repos I have, so I came up with a little python program that allows the user to use a config file with the repositories being used from git to be either listed, or mass-updated.

You can pick up a copy via git:

Code: Select all

git clone https://github.com/DebianJoe/gitupper
The above includes an example config for how to specify the paths to each repo. Also, this project is only now starting to be worked on, so if you'd like to see more additions, changes, etc. then let me know. I'll probably add an option soon to specify single repos via the name that you call them to be updated one at a time...but that's not there yet.

Requires git, python 2.5+, python-ConfigParser (if you have roaster...then you've got everything you need for it.)

Installing:
=======
You can 'chmod 755 gitupper' and copy 'gitupper' to some directory in your $PATH (cd to cloned directory and with root permissions "cp gitupper /usr/bin/gitupper") and run it from anywhere via "gitupper -ls" to list the repos in your config, or "gitupper -up" to update all of the repos to the current git versions. You can also just cd to the directory that it's stored in and 'python gitupper [-ls] or [-up]' to run it directly from the interpreter. It will let you know what is being done in each directory by writing the name of the directory above what has happened during the pull.

Warning:
======
I busted this out in about 30 minutes this morning. It may not work perfectly yet. No warranties. ;)
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
xaos52
The Good Doctor
Posts: 190
Joined: Thu Aug 15, 2013 11:59 am
Location: Eernegem, Belgium

Re: gitupper, basic dist-up via git

Unread post by xaos52 » Sun Sep 08, 2013 5:53 pm

Tx Joe, but
the instaling instructions should read: copy gitupper.py from the cloned repo to gitupper in your PATH...
Yes, I am a nitpicker, I know...
Connected. Take this REPL, brother, and may it serve you well.

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: gitupper, basic dist-up via git

Unread post by DebianJoe » Sun Sep 08, 2013 6:05 pm

No problem doc. Dropped the .py in the repo, so now instructions make more sense.

Perhaps I should just create a makefile for it...but it's still a decent distance from doing everything that I want yet.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: gitupper, basic dist-up via git

Unread post by DebianJoe » Mon Sep 09, 2013 8:17 am

Added option to be ran as "gitupper -up {repo_name}" to update only one repo at a time. Bails on invalid arguments with a short explanation of syntax that is acceptable. Performs check for git before attempting updates, on failure it lets user know that it requires git. Done in less than 100 lines of python.

Xaos52, "Come at me Bro!" (aka: point out issues if you see them)
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: gitupper, basic dist-up via git

Unread post by DebianJoe » Sun Sep 15, 2013 11:01 am

Just for the sake of completeness, added the option for -gc to roll through each repo listed in your personal config and do garbage collection, pruning, and fsck the repos. Now 115 lines, but probably a more useful program.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

Post Reply