Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

BizarroAzrael posted:

The master script, which calls all the other scripts to perform the update, is to be versioned as Update.bat.template, so users will need to cut off the ".template" and unversion it for it to work. Doing this for the other scripts seems impractical though, I don't want users having to muck around with them themselves. I thought about having them versioned as .templates as well, and having the master script rename them. Would it work to have the script rename them all by removing the .template? Then the update would restore the original .bat.template files which would be used next time the update runs.

I think I've just hit on the solution whilst writing this, but I'd like to hear what anyone thinks.

We did pretty much the same thing at the last place I was at, except putting it in a directory rather than renaming files from .template. It made things a bit easier since you had a working file if you were working with the source controlled version (especially useful because we had a series of files which referenced each other), and you could run the update script from any directory.

Later on down the road our update got quite a bit more complex, so the .bat file ended up being a bit of a loader script that only updated the main updater tool and then executed it (by that point it was actually a winforms app). That was probably the least painful, as you didn't have the "double-update" whenever you updated the updater.

Adbot
ADBOT LOVES YOU

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

Dromio posted:

I've heard good things about git-flow. This guy gives a nice concise example of it.

Git flow is absolutely amazing and I can't imagine developing without it. It basically wraps up every best practice you should be following with git into an easy-to-understand syntax. Even if you're just working on something yourself and don't really need deployment branches and all that jazz, just working with "feature start" and "feature finish" feels a lot more natural and less repetitive than working directly with git.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

Mithaldu posted:

The finish bit seems pretty meh. It seems much more useful to rebase the feature branch onto master, dealing with conflicts step by step and then merging it into master with --no-ff so there's still an explicit record of it being a feature branch.

Maybe I'm not following, but you should be rebasing your main branch into your feature branches every so often and before the finish anyway, so by the time you actually merge your feature into development with finish, you shouldn't really have many conflicts to deal with anyway.

I can see the point about --no-ff, but it's not personally a concern for me.

If you're talking about running a rebase when you're on master with your feature branch, that would blow up like crazy if you have more than one developer.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
I was confused if you were saying "git rebase master" from the feature branch (which yeah) or "git rebase feature" from the master branch (which gently caress no).

Rebasing master into your feature branch with git flow is 100% something you should be doing and git flow doesn't impact or prevent that at all.

In regards to --no-ff, yeah, I honestly don't give a poo poo if the feature ceases to exist when I'm done with it, but that's just me.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
Another awesome option for bug tracking / continuous integration is Jira + Bamboo. It isn't free, but for less than 10 people it's a $10 one-time fee for each (you might want to bump it up to $30 and get a Greenhopper license as well since it's amazing and makes Jira a billion times better.)

Jira is almost certainly overkill for a 2 man team, but it's still dead simple to use, and it will scale to pretty much any workflow you could possibly want.

Bamboo is optimized towards building Java projects out of the box, but I didn't find it too difficult to get Rails projects building on it.

As an added plus, Atlassian (the company who makes all this stuff) owns Bitbucket, so the integration between Jira / Bamboo and Bitbucket is pretty awesome.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
Rebasing generally isn't going to do a lot to avoid when conflicts happen though. Depending on when commits occurred, you may get lucky, but it certainly doesn't mean you'll never need to deal with them.

nexus, one thing to keep in mind when working on branches that persist for longer than a day or so is that it's possible, and even recommended, to pull in changes from master periodically when you're working on your branch. If you do this, you'll reduce the odds of hitting conflicts when you have a huge amount of changes in your branch that need to be merged with a huge amount of changes in the master branch.

I would personally start off each morning by running (from your branch):

code:
git fetch
git merge origin/master
This will ensure that anything anyone has pushed into master is now in your branch.

Now, there's still a possibility that you're going to have merge errors (you almost certainly will at some point, at the end of the day no SCM is going to get around 2 people editing the same line of code). To see what's going on when you get a merge error, run git status. The list at the very bottom is the list of files you need to resolve. Once you've opened those, and resolved the conflict, just git add them and commit when all of your files are merged successfully.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
I think it's totally reasonable to review a branches changes before you merge - we do that with another developer literally every time we pull anything into our mainline branch.

git diff master..branch_name will give you all the commits. If you want something prettier than text output, I'd imagine all of the graphical tools have some sort of diff available. Better yet, if you're on GitHub, you can use pull requests to get a great diff view before merging, and even add comments for things to fix before you pull it into your mainline.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
By the way, I just downloaded SourceTree, and I wanted to say it's a pretty awesome repository browser. I still like to do most of my actual commits on the command line, but to get a visual of what's going on, or a nice pretty diff, it's pretty awesome.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

Mithaldu posted:

Bullshit, that's not your dev being stupid. That's your devops being stupid and deploying from master instead of a dedicated release branch.

Depending on your setup, there's nothing wrong with pushing from master. GitHub does it, for instance.

We do it as well, but our "master" is less of a typical mainline, and more of a deployment branch. The only branch that ever gets merged into master is development or a hotfix branch we branched from master. Nothing gets to master unless all tests pass on development, and our staging server always has the current state of the development environment. The second something gets on master, it gets pushed to production.

It works fine for us, and branching off release branches would add a lot of complexity for literally zero benefit.

enki42 fucked around with this message at 13:17 on Mar 8, 2012

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
Also, this doesn't exactly answer your question, ufarn, but one thing that we use to ensure that we aren't pushing unwanted changes to master, and just as a good way to review your code, is require that all changes to master are sent up as a pull request to GitHub. If you guys are using that, the diff view on a pull request really is excellent, and it lets you interactively add comments on certain line numbers and other nice things like that.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

Mr. Crow posted:

This was my original thought on the process but it seemed to... simple. I dunno. Like I had to be missing something. Good to know it's effective!

Because I still don't fully comprehend the differences between the two, is there some reason that would make this less effective with SVN vs git?

The main difference with "github-flow" vs. "git flow" is that github does deployments more or less immediately after something is checked into the main branch. If you can do this (and REALLY do this - i.e. your time from checking into master to deploy is less than a couple of hours and fully automated), then git flow adds a lot of ceremony you don't need.

If you do have something like manual QA tests, scheduled releases, or anything else that prevents continous deployment, you will get burned by using the github style of doing things.

At the end of the day, there's not really an objectively "good" branching model - just ones that are better and worse fits for your workflow.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

Volmarias posted:

That sounds neat. Does it have explorer integration?

If it's anything like the mac version, no, it's pretty self contained, and much more useful as a commit browser than a tree browser, if that makes any sense (I don't even think there's a way to view the file structure at a particular commit).

It's a great tool even if you do use the command line pretty heavily though - I personally never use it to commit, but it's great for quick code reviews when I don't want to bother with a pull request, or being able to browse around the commit history and checkout a particular rev or something.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

Strong Sauce posted:

So I have developed a feature, "A" off the "dev" branch. Let's say I make a PR for A and while it's being reviewed dev gets other commits/merges into it.

I need to create a feature B that I branch off of A, however once A eventually gets merged back into dev I would like B to be based off dev instead of A so I can do local git rebases without affecting any commits that are part of origin/dev.

I haven't done this yet but I'm thinking that once A gets merged into dev, I just go back onto the dev branch, create a new temp branch, "C" then merge the old B branch into C.

You don't really need to do anything with a 'C' branch. It helps to think of this kind of stuff if you remember that you don't really branch off a branch, but off a commit. Your 'B' branch isn't really branched off 'A', it's branched off a specific commit on the 'A' branch at the point that you branched it. So once the pull request is accepted and 'A' is on dev, the ancestor commit is on dev, and 'B' is already branched off of dev in a sense.

Adbot
ADBOT LOVES YOU

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!
I'm a git user who probably wouldn't switch if given the option (although I've been meaning to checkout mercurial), but the Git CLI is unforgivably horrible for UX even if you otherwise have no problem with the command line.

  • The switches are massively inconsistent. To remove files, I use `git rm`, to remove branches `git branch -d`. Sometimes I can force with `-D`, sometimes I can't (i.e. to remove a tag)
  • The commands themselves behave in weird, inconsistent ways. For instance, `git add .` will add untracked files, but won't stage deletions. `git add -p` will stage deletions, but won't add untracked files. There's no logical reason for this other than "that's how it works"
  • Some commands are destructive without any real safeguards. If I run `git checkout .`, I've lost everything I haven't committed or staged, without warning or any way to recover those files.
  • It's the leakiest abstraction ever. Once you get beyond the basics, it becomes necessary to know how the reflog works - in general, I shouldn't need to know how a program works "under the hood" for fairly normal usage.
  • There's too many ways to essentially break a repository (which can be recovered from, but not without knowing a lot about the internals of git) through relatively common stuff like rebasing shared branches. Nowhere in the git commands themselves is there a warning that this will get you into a world of pain.

enki42 fucked around with this message at 14:24 on Feb 28, 2014

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply