Fedora Linux Support Community & Resources Center
  #1  
Old 31st January 2012, 02:46 PM
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Confoederatio Helvetica (Swissh)
Age: 34
Posts: 3,278
linuxfedorafirefox
Using GIT to update scripts at enduser?

Heyas

Been playing a little with GIT, but since i only use it for a single-person-project, i'm far away of beeing used to it, as there are not many 'issues' showing up.

Anyway, so far i had figured that:
1) push uploads files
2) pull downloads 'git-history'
3) checkout overwrites/restore files from local git-history

So to achieve an update at the enduser, as long they have git installed, i would do it like (pseudo-code):
Code:
#PSEUDO-CODE
for each module;   do
      update module history with pull
      checkout files of module
done
Do you think this is a propper approach, or is there a better solution i havent thought of yet?

Thank you in advance!

---------- Post added at 03:46 PM ---------- Previous post was at 02:19 PM ----------

As i thought, i'm running into issues due to the lack of experience

Error message:
Code:
udpate: core.... 
fatal: Not a git repository (or any parent up to mount parent /usr)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: Not a git repository (or any parent up to mount parent /usr)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
udpate: lfs....
fatal: Invalid refspec '/usr/.scripts/sc/collection/lfs'
udpate: set....
fatal: Invalid refspec '/usr/.scripts/sc/collection/set'
udpate: sup....
fatal: Invalid refspec '/usr/.scripts/sc/collection/sup'
Code Segment:
Code:
updatecollection() { folder=$1
        #testi=$(git --version) || echo "GIT is not installed, please install it and try again." && return 1
        for m in core lfs set sup QUIT ; do
            test "QUIT" = "$m" && break
            
            case $m in
                core)   echo "udpate: $m.... "
                        cd $folder
                        git init # seems to 'help'
                        git pull git://git.code.sf.net/p/seasc/core/sc-core  $folder  
                        git checkout -f
                        ;;
                *)      echo "udpate: $m...."
                        cd $folder/collection/$m
                        git init # init
                        git pull git://git.code.sf.net/p/seasc/sc-$m/sc-$m $folder/collection/$m 
                        git checkout -f  
                        ;;
            esac
        done
    }
updatecollection /path/to/script-collection
Ok, so my script source code is located on a seperate partition...
Code:
/dev/sda7 /usr/.scripts           xfs     defaults        1 2
How is that influencing the git repo, as the scripts and its module all reside in a subfolder of the script partition?

EDIT:
Heck, i even start the script from inside that partition

EDIT 2:
* An easy to read introduction of GIT by Eli M. Dow of IBM: http://www.ibm.com/developerworks/linux/library/l-git/
* A very technical explanation of GIT checkout by Linus Torvalds: http://linux.die.net/man/1/git-checkout
These two helped me to pass the first few issues i'd faced.
The 'best' article i've found regarding the cross-partition issue is this: http://stackoverflow.com/questions/7...-and-macfusion.

EDIT 3:
Ok, using GIT INIT after i changed to the folders, seem to help if the scripts were downloaded as tarball.
However, this brings up a new issue
Quote:
udpate: core....
fatal: Couldn't find remote ref /home/simon/sc
fatal: You are on a branch yet to be born
udpate: lfs....
fatal: Couldn't find remote ref /home/simon/sc/collection/lfs
fatal: You are on a branch yet to be born
....
....
EDIT 4:
What confused me the most, i dont even use branches...well, only master...

EDIT 5:
Grr, cant upload code, as i got hit by the 3.2.2-1 wifi bug, and since it didnt happen until now, had deleted the old kernels
__________________
Laptop: Toshiba satellite p50-a-11 CPU: Intel i7 8*2400 MHz GPU: GeForce GT 745M RAM: 8192 MB Distro: Fedora (Rawhide) DE: Awesome
Text User Interface (TUI) // Windows 8+ & Fedora 20+ Dualboot

Last edited by sea; 1st February 2012 at 12:13 AM.
Reply With Quote
  #2  
Old 3rd February 2012, 12:56 AM
sanhozay Offline
Registered User
 
Join Date: Jan 2012
Location: Leeds, UK
Posts: 39
linuxfirefox
Re: Using GIT to update scripts at enduser?

Did you consider just cloning the repository initially and then using pull to drag down updates?

Code:
$ git clone <location of your scripts>

// Some time later when the scripts are updated ...

$ git pull
I didn't notice the official Git tutorial in your reading list but it's very accessible and worth a read, especially the section on collaboration. You can view it as a manual page:

Code:
$ man gittutorial
Reply With Quote
Reply

Tags
enduser, git, scripts, update

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
scripts... how to ? Flemming Using Fedora 7 23rd October 2011 07:50 AM
yum and scripts assalane Using Fedora 3 5th March 2009 11:48 AM
How do you run scripts Swaytech Using Fedora 12 20th January 2006 06:03 AM
not able to run scripts spie34 Using Fedora 9 26th August 2004 06:31 PM
Scripts earobinson111 Using Fedora 1 1st August 2004 10:55 PM


Current GMT-time: 04:39 (Tuesday, 29-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat