My Adventure Game Engine - Making Way For Adventure Engine 2

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by Robin »

Something which might be useful:

Code: Select all

git commit -a
This takes all changes and puts them in the commit you make (except new files, it won't add any new files unless you tell Git to).

I use it so often, I have a two-character alias for it.
Help us help you: attach a .love.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by kikito »

I used to do that, until I realized that it adds changed files to the commit, but not new files. As a result, I had this tendency to forgetting adding new files. So I stopped using git commit -a.
When I write def I mean function.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by Jasoco »

Why is there no automatic sync that uploads both changed files and new files without having to remember which files you added or changed? Who designed that thing? Was it the early 21st century because technology has advanced so far, GIT is so far behind! WTF?

And if I try "git commit -a" it takes me into VIM and asks me to enter a message. But won't tell me how the fuck to actually send the message! F*** I HATE VIM! GOD DAMN WHAT A S***TY PROGRAM!

Did I mention I HATE VIM? I DON'T KNOW THE F***ING KEY COMMANDS TO SEND THE F***ING MESSAGE F***ING HELL!!

Why do I have to do it manually? This is 2010. It should be automatic single command, single button push of all changed, new and moved files without any user interaction. This is why I didn't want to use GIT.

Edit: Pardon my anger. The bank screwed up my check deposit and I am worried they won't fix it. Also, I saw a girl wearing a "Team Cullen" T-shirt. So you can understand I'm a little irritable.
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by nevon »

Jasoco wrote:Why is there no automatic sync that uploads both changed files and new files without having to remember which files you added or changed? Who designed that thing?
git add *
Well, that adds adds them to your next commit. After that, just git commit -m "message" && git push.
Jasoco wrote:Was it the early 21st century because technology has advanced so far, GIT is so far behind! WTF?

And if I try "git commit -a" it takes me into VIM and asks me to enter a message. But won't tell me how the fuck to actually send the message! F*** I HATE VIM! GOD DAMN WHAT A S***TY PROGRAM!

Did I mention I HATE VIM? I DON'T KNOW THE F***ING KEY COMMANDS TO SEND THE F***ING MESSAGE F***ING HELL!!
Dude, chill! Git is awesome. I'd dare say you won't find many professional and/or knowledgeable software developers that don't think version control systems are awesome. If you want a pretty GUI, there are plenty to choose from - and they're all just a google search away.
Jasoco wrote:Why do I have to do it manually? This is 2010. It should be automatic single command, single button push of all changed, new and moved files without any user interaction.
There is. You just didn't know it already (despite me actually mentioning it in my first step-by-step). There's a learning curve to everything. Git is crazy easy to use once you've gotten used to it (which shouldn't take more than a few days).
Jasoco wrote:Also, I saw a girl wearing a "Team Cullen" T-shirt.
Oh! Then it's all perfectly understandable.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by Jasoco »

Is it safe to add all files every time? Won't that upload all 5MB of it each time? Even though 4.99999MB hasn't been changed yet?

Edit: Seemingly not. So, how would I go about making a shell script that will CD to the project directory, add *, commit changes while prompting me for a password, then update the files?
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by thelinx »

When adding files, it actually adds the changes.

When committing, it stores those changes as a checkpoint.

Please, check out http://gitref.org. It's for your own good.
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by nevon »

Jasoco wrote:Is it safe to add all files every time? Won't that upload all 5MB of it each time? Even though 4.99999MB hasn't been changed yet?

Edit: Seemingly not. So, how would I go about making a shell script that will CD to the project directory, add *, commit changes while prompting me for a password, then update the files?
Like thelinx suggests, read the Git Reference. It will explain things a million times better than I could. In short, add * only adds the stuff that has been changed; and it doesn't upload anything (push uploads).

As for a shell script, I guess:

Code: Select all

#!/usr/bin/env bash
cd ~/project-directory
git add *
git commit -m $@
git push origin master
Usage would be: ./shellscript.sh Commit message here.

I haven't tested it though, so I have no idea if it would actually work. You should really just learn the commands and do it manually - either using the command line or using a GUI. There's only like 4 commands that you'll be using often anyway.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by Robin »

You can change the editor. With the environment variable $GIT_EDITOR, for example. Or $EDITOR, which would change the editor used for pretty much any CLI script or program that needs to invoke an editor. Also, you can use -a and -m together. I think you can set an alias to

Code: Select all

alias com='git commit -am'
so you can type

Code: Select all

com "Added Snakes() to plane.lua"
or whatever you want :3

btw, Git is actually one of the most modern ways to organise your code in existence. Started in 2005, because the makers of BitKeeper were withdrawing the free version, and none of the other systems were good enough for Linus Torvalds. Mercurial has the same back-story, and is very similar to Git in day-to-day use, however underlying philosophy and inner workings are vastly different.
Help us help you: attach a .love.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by TechnoCat »

There are a few reasons why it doesn't automatically upload it every time:
1. Your changes aren't always a good thing.
2. A lot of times repo's are used for group projects. And you can't be forcing everyone to merge non-functioning or partial code with everybody's stuff every time you save a local change.
3. How would you comment your changes if it automatically synced changes? Comments are super useful.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: My Adventure Game Engine - GIT is hard. Need help please

Post by Jasoco »

This isn't a group project though. Well, not like that other project. And only changes that I want shown will be updated. I don't need automatic as in timed syncs. I just want a simple one-button approach to add, commit and push it all. Can't seem to get the Shell script working though. Keeps saying "Permission Denied".

Code: Select all

#!/usr/bin/env bash
cd ~/Documents/Coding\ Projects/LÖVE/Adventure
git add *
git commit -m $@
git push origin master
What does "origin master" do? I was just using "git push".
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests