Trying to get GIT

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • APWhite
    Adept
    • Jul 2007
    • 244

    Trying to get GIT

    One of these days, I need take about 3 hours and do some research on how to fully use the GIT. Then, I could stick the borg files into the angband project.

    I signed up for a github account. I have gitbash or something like that on my machine. But I have not had the chance to sit down with it and see how to download and integrate the git files with those on my machine. Or even better, how do I upload my frequent borg updates to the git repository?

    I hope youtube has some good training videos.

    Oh ya, BTW. Can I get permission to make commit changes to the library? The borg and screen-saver need to have a few changes to the game code. It's easiest if I make them.
    Last edited by APWhite; April 16, 2011, 05:35.
    St George Chiropractor
    Angband Borg Homepage
  • camlost
    Sangband 1.x Maintainer
    • Apr 2007
    • 523

    #2
    I think, basically, you can clone the main angband repository and make and commit changes to your own version. Then, someone with access to the main-line can merge your changes into the production version.

    Whenever you want to update your version to production, you simply merge any changes in production into your own version. You'll keep any changes that you've made that aren't in production and get any that made it into production after you cloned it initially.

    Does that make sense? Is this more or less correct for git (I'm more experienced with SVN)?
    a chunk of Bronze {These look tastier than they are. !E}
    3 blank Parchments (Vellum) {No french novels please.}

    Comment

    • myshkin
      Angband Devteam member
      • Apr 2007
      • 334

      #3
      You should follow the instructions on the GitMaster page on the rephial wiki. The "Setting up" and "Feature branches" apply to you. Once you have changes that you want us to pull into the mainline, let us know, and we can merge them.

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #4
        Originally posted by myshkin
        You should follow the instructions on the GitMaster page on the rephial wiki. The "Setting up" and "Feature branches" apply to you. Once you have changes that you want us to pull into the mainline, let us know, and we can merge them.
        http://trac.rephial.org/wiki/GitUsage might also be helpful. The the key steps are

        1. Go to http://github.com/angband/angband and click Fork. That will create a copy of the official repository in your own github account.

        2. git clone git://github.com/you/angband. That will make you a local copy of your github fork, so that you can work on the code. Once you've done this, you can make a borg branch and start integrating your code - including making any changes you need to the rest of the code.

        3. git push origin borg. That will push your new branch, with the integrated borg code, up to github. When you've done that, let us know and we can try to merge it. Don't worry about keeping up-to-date with nightlies - merging will be tricky anyway.
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • AnonymousHero
          Veteran
          • Jun 2007
          • 1393

          #5
          Originally posted by APWhite
          One of these days, I need take about 3 hours and do some research on how to fully use the GIT.
          That is the exact point at which you will find out about the bottled awesomesauce that accompanies every git install.

          Comment

          • APWhite
            Adept
            • Jul 2007
            • 244

            #6
            Is there a way to copy the files from the online repository onto my machine or do I have to do some line-by-line copying?
            St George Chiropractor
            Angband Borg Homepage

            Comment

            • takkaria
              Veteran
              • Apr 2007
              • 1951

              #7
              Originally posted by APWhite
              Is there a way to copy the files from the online repository onto my machine or do I have to do some line-by-line copying?
              You might want to read a git primer, e.g. this one and go from there.
              takkaria whispers something about options. -more-

              Comment

              • Magnate
                Angband Devteam member
                • May 2007
                • 5110

                #8
                Originally posted by APWhite
                Is there a way to copy the files from the online repository onto my machine or do I have to do some line-by-line copying?
                Git clone does exactly that - copies the entire online repo to your local machine.
                "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                Comment

                • takkaria
                  Veteran
                  • Apr 2007
                  • 1951

                  #9
                  Hey APW,

                  I've seen the changes you've made so far in your repository, but I'd like to suggest different changes:

                  1. Putting 'extern' (and an extra comment line) in front of all the arrays in player/calcs.c is bad style. "extern" means "this is defined in another file", not "this is used in another file". When you define an array at the same time as saying "don't use this definition, it's defined elsewhere", compilers will get confused (I think this is the cause of some warnings in another thread). Just removing "static" will have the intended effect, and if you want us to pull this code into the main repository, I'd prefer not to have 'apw' tags.

                  2. I see you've re-added some removed macros to z-virt... please could you update the borg code not to use them instead of adding them back in? They were removed because they're really bad style and there are better ways to write the same code that makes it more obvious what's going on. Replacing all instances of
                  i. MAKE(P, T) with P = ZNEW(T) and
                  ii. C_MAKE(P, N, T) with P = C_ZNEW(N, T)
                  will do the trick.
                  takkaria whispers something about options. -more-

                  Comment

                  • APWhite
                    Adept
                    • Jul 2007
                    • 244

                    #10
                    Originally posted by takkaria
                    Hey APW,

                    I've seen the changes you've made so far in your repository, but I'd like to suggest different changes:

                    1. Putting 'extern' (and an extra comment line) in front of all the arrays in player/calcs.c is bad style. "extern" means "this is defined in another file", not "this is used in another file". When you define an array at the same time as saying "don't use this definition, it's defined elsewhere", compilers will get confused (I think this is the cause of some warnings in another thread). Just removing "static" will have the intended effect, and if you want us to pull this code into the main repository, I'd prefer not to have 'apw' tags.

                    2. I see you've re-added some removed macros to z-virt... please could you update the borg code not to use them instead of adding them back in? They were removed because they're really bad style and there are better ways to write the same code that makes it more obvious what's going on. Replacing all instances of
                    i. MAKE(P, T) with P = ZNEW(T) and
                    ii. C_MAKE(P, N, T) with P = C_ZNEW(N, T)
                    will do the trick.
                    Sure I can make those changes.

                    Removing the apw tags would simple enough. Its not ego. I have them there because it is easy to search for apw to find the needed code changes. Once the code changes have been added to the main code base, there would be no need to have the tags.

                    I was using GIT GUI and it does not seem to be very friendly. I do not see how I can add files to my repository. Staging them and committing them poops out as well. I have not had enough free (uninterrupted) time to learn all the terms (push, stage, commit, etc).

                    I found today, that after making some changes to my code, when I loaded up the Git GUI, it recognized the changes and listed those code changes. That was nice.

                    I have not seen how I can add a file to the online repository. My local repository has the borg stuff but the GUI did not ask for my online login information. Again, this is through the GUI, I have not used the command line tool.
                    St George Chiropractor
                    Angband Borg Homepage

                    Comment

                    • myshkin
                      Angband Devteam member
                      • Apr 2007
                      • 334

                      #11
                      Originally posted by APWhite
                      I have not seen how I can add a file to the online repository. My local repository has the borg stuff but the GUI did not ask for my online login information. Again, this is through the GUI, I have not used the command line tool.
                      I found this guide to using the Git GUI on Windows; it may be of some assistance. The Pushing to a Remote Server section describes how to push your changes to github.

                      Comment

                      • d_m
                        Angband Devteam member
                        • Aug 2008
                        • 1517

                        #12
                        Here are the basic steps that I would use to fork the angband/angband repository on github and add/change a bunch of files, and publish those changes back to my fork (steps starting with $ are in git-bash):

                        =========================

                        GETTING STARTED:

                        0. set up git/SSH keys via http://help.github.com/win-set-up-git/

                        1. fork angband/angband into USERNAME/angband via github website
                        USERNAME should be the github login name

                        2. $ git clone git@github.com:USERNAME/angband.git WORK
                        this will create a directory called WORK which has all the files checked out

                        3. $ cd WORK

                        4. $ git remote add official git://github.com/angband/angband.git
                        this will be useful later... it will allow you to easily keep your fork in sync with V development

                        5. edit/overwrite existing files as necessary

                        6. copy in new files

                        (for each new file)
                        7. $ git add path/to/new/file.c

                        8. make sure things work ok

                        9. $ git commit -m "helpful message about changes" -a

                        10. $ git push origin master

                        KEEPING IN SYNC:

                        1. git fetch --all

                        2. git rebase official/master
                        this will pull down all the changes from the central development version and apply them to your fork.

                        ========================

                        This all assumes you aren't doing anything fancy, like creating different branches and whatnot. Hopefully if you're doing that you won't need my guide.

                        Good luck!
                        linux->xterm->screen->pmacs

                        Comment

                        • AnonymousHero
                          Veteran
                          • Jun 2007
                          • 1393

                          #13
                          Just a little warning about d_m's instructions. Using "git rebase" is a definite no-no if you've pushed your changes anywhere -- you should use "git pull" instead.

                          Comment

                          • d_m
                            Angband Devteam member
                            • Aug 2008
                            • 1517

                            #14
                            Originally posted by AnonymousHero
                            Just a little warning about d_m's instructions. Using "git rebase" is a definite no-no if you've pushed your changes anywhere -- you should use "git pull" instead.
                            Ah right. In that case you'd want to replace the rebase with "git merge official/master"
                            linux->xterm->screen->pmacs

                            Comment

                            • APWhite
                              Adept
                              • Jul 2007
                              • 244

                              #15
                              This is great help. I did most of the steps. I hope to get it up an running soon.

                              I did find that after I cloned the angband.git, a directory was created on my drive at C:\Documents and Settings\Toshiba Owner\Borg\src

                              I use MS Visual Studio2008 for all my work and the source files are stored elsewhere on my drive. Do I have to create a new VS2008 project and use the files contained in the new clone directory or is there a way to tell Git that I am using a separate directory and Git should be looking in there instead?

                              It almost looks like it would be easier to create a new VS2008 project pointing to the source in the new Git clone directory.
                              St George Chiropractor
                              Angband Borg Homepage

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎