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
wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

poty posted:

I'm starting my first project with CVS (or Version Control in general) in a few days. It's an established project that's been going on for years. I've quickread a couple of tutorials and I think I get it, but I'm still concerned.

How easy or hard is it to gently caress up? Do you have confirmations before you delete stuff or since it's geared towards developers it assumes you know what you're doing?

For the love of God, when you're learning a new version control system, back up your source tree on your local computer every once in a while, particularly right before doing a commit/update/merge.

Screwing up the repository on the server is varying degrees of difficulty, ranging from relatively easy with CVS to almost impossible with just about anything else, but you will, at least once in your learning process, accidentally wipe out your local changes.

The best way to avoid this, somewhat counter-intuitively, is to commit often. The really rough stuff starts to happen when your local tree is way out of sync with the server tree. The flipside to that is, you don't want to commit partial changes. The thing to work toward is learning to conceptually break big changes up into smaller self-contained changes. That'll also aid in testing.

Adbot
ADBOT LOVES YOU

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

ufarn posted:

Not sure it went as planned. I had forgotten to delete .git-rewrite and grant git bash full permissions. This is what I got:

...

And this is what my tree looks like:



It didn't go as planned because you told git filter-branch to make some changes that are already applied. That is, "make a new commit with the author and committer set to these values, but everything else the same" resulted in identical commits since the authorship information already matched the modification you did.

Run this:
code:
git filter-branch -f --env-filter 'export GIT_AUTHOR_NAME="John Appleseed";
export GIT_AUTHOR_EMAIL="john@appleseed.com";
export GIT_COMMITTER_NAME="John Appleseed";
export GIT_COMMITTER_EMAIL="john@appleseed.com"' HEAD~24..HEAD
Assuming that I counted correctly, HEAD~24 is the commit that's pretty far down, right before the first of the two with bad email addresses. I assume that you want to rewrite that entire range to also fix those two commits.

Golbez
Oct 9, 2002

1 2 3!
If you want to take a shot at me get in line, line
1 2 3!
Baby, I've had all my shots and I'm fine
I need some help/advice with git.

Here's the sequence of events I just went through. We use gitolite.

1) Merged new branch into master.
2) Pushed.
3) The post-receive hook on the server side then went to our production directory and did its "git pull origin master" to get the code from the gitolite repository to the website.
4) We discovered a bug moments later.
5) I open gitk, right click the previous commit and say 'reset master branch to here'.
6) I commit and hit git push, forcing the matter.
7) The gitolite repository now has the reverted master.
8) However, when the hook executes, it sees that the version in the web directory is newer than the version in the gitolite repository, and does nothing.

How can I force this last command to pull the version that's in origin? I've tried git pull -f origin master but it still says 'Already up to date".

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
git reset origin/master --hard

Note that in step five you probably should have reverted rather than resetting. Rewriting private history can be awesome, but rewriting public history rarely is.

Golbez
Oct 9, 2002

1 2 3!
If you want to take a shot at me get in line, line
1 2 3!
Baby, I've had all my shots and I'm fine

Plorkyeran posted:

git reset origin/master --hard

Note that in step five you probably should have reverted rather than resetting. Rewriting private history can be awesome, but rewriting public history rarely is.

Thanks!

I was panicking and went with the first option that appeared. What command should I have done, just 'git revert' and give it the id?

Golbez fucked around with this message at 20:43 on Feb 28, 2012

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Yes, or just git revert HEAD for the specific case of reverting the last commit.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
Out of curiousity: Are any of you SVN/git guys going to be taking a look at TFS express?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I can't really imagine any situation where I'd choose to use TFS short of "Made by Microsoft" being a hard requirement.

wwb
Aug 17, 2004

I'm a pretty dyed in the wool MS guy and I won't use sharepoint or TFS because the products blow that much.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

wwb posted:

I'm a pretty dyed in the wool MS guy and I won't use sharepoint or TFS because the products blow that much.

I don't know enough about Sharepoint to debate the point, but why do you think that TFS blows?

My employer does TFS consulting and I'm currently writing a bunch of cool software leveraging the TFS API, so I'm curious to know what soured you on it.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I don't think TFS is awful per se, but it's a centralized source control system that's overly tied to Visual Studio and doesn't really have any compelling features to make up for this.

wwb
Aug 17, 2004

Locked checkouts. Needing $8k + worth of licensing to work beyond TFS. Sharepoint integration. Requiring Visual Studio on my build server.

I've heard TFS2010 is better, and the API might well be good. But it is managerware more than useful development tool.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

wwb posted:

Locked checkouts.

You can explicitly lock a file, but I've never seen a good reason to do so. It defaults to no locks, at least in 2010.

quote:

Needing $8k + worth of licensing to work beyond TFS.

TFS can be pricey, I'll give you that. That's why Microsoft is releasing an Express edition; they want to upsell.

quote:

Sharepoint integration.

Sharepoint isn't required to use TFS. If you're going to ding it because it can integrate with Sharepoint, I don't know what to tell you.

quote:

Requiring Visual Studio on my build server.

Not true, as far as I know. I could be wrong on this one, though.

quote:

But it is managerware more than useful development tool.

I've only used VSS and TFS (2008, 2010, and the beta of version 11) professionally, so I can't speak to the strengths and weaknesses of TFS over anything other than VSS. I'd disagree with that statement, though. With a minimum amount of dicking around, you can have source control and CI scripts running. If anything, I've seen the "managerware" aspects of it misused/underused/unused more than the source control aspect.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

Ithaqua posted:

Out of curiousity: Are any of you SVN/git guys going to be taking a look at TFS express?

I assume the client and server software don't run on Linux or Mac OS, so that's a resounding "no". I'll also never consider going back to a centralized version control system for managing code; maybe for huge art assets that graphic designers work on.

(Seriously, why would you develop software on/for Windows in 2012? :v:)

wwb
Aug 17, 2004

^^^Just got through working our art department through the move from SVN to HG. Actually went pretty well. Hard part is selling them on the concept of sane and rational version control. Getting them to use the tools is relatively easy.

@Ithaqua: very reasonable retorts. I will concede I am perhaps a bit too negative on the product. On the other hand:

quote:

I've only used VSS and TFS (2008, 2010, and the beta of version 11) professionally, so I can't speak to the strengths and weaknesses of TFS over anything other than VSS. I'd disagree with that statement, though. With a minimum amount of dicking around, you can have source control and CI scripts running. If anything, I've seen the "managerware" aspects of it misused/underused/unused more than the source control aspect.

I've got SCM and CI setup using SVN, git and HG and TeamCity in matters of minutes. Really issue tends to be the project not being CI-friendly rather than the SCM platform or CI server. TFS does do some things to make it easy, but the stuff it makes possible really isn't hard.

Magicmat
Aug 14, 2000

I've got the worst fucking attorneys
How do I get hg to ignore further changes to a file? I have a file that is generated. There's a version in the repo that is considered the 'canonical' version, however the file is regenerated every time I run my program. I want to hg to ignore those local changes and never ask me to commit it again.

I added the file to .hgignore, but that just stops the file from being added to the repo if it isn't already; it will still try to add changes to the file into the repo if the file already exists in the repo.

This is annoying both for the aesthetic issue, but also because hg doesn't like to merge or do other potentially destructive changes with uncommitted local changes.

musclecoder
Oct 23, 2006

I'm all about meeting girls. I'm all about meeting guys.

Magicmat posted:

How do I get hg to ignore further changes to a file? I have a file that is generated. There's a version in the repo that is considered the 'canonical' version, however the file is regenerated every time I run my program. I want to hg to ignore those local changes and never ask me to commit it again.

I added the file to .hgignore, but that just stops the file from being added to the repo if it isn't already; it will still try to add changes to the file into the repo if the file already exists in the repo.

This is annoying both for the aesthetic issue, but also because hg doesn't like to merge or do other potentially destructive changes with uncommitted local changes.

You can't do this as far as I know in any versioning system. If the file is versioned, it's versioned for good.

What you can do is take the good file, make it file.good.template and commit that to the repo, then ignore file.good and just copy file.good.template to file.good as part of your build process or manually when you first clone the repo.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I just started actually doing branching and merging with TFS, and I don't get why something happened the way it did. I created my branch, and did my crap. I checked in all that code into my branch. Afterwards, I merged the main branch into my branch, dealt with the conflicts, then checked it in. I then tried to merge my branch into the main, and I got a few conflicts. Between the time of the two merges, nobody else had committed anything into main. So how could that have even happened?

Comrade Gritty
Sep 19, 2011

This Machine Kills Fascists

musclecoder posted:

You can't do this as far as I know in any versioning system. If the file is versioned, it's versioned for good.

What you can do is take the good file, make it file.good.template and commit that to the repo, then ignore file.good and just copy file.good.template to file.good as part of your build process or manually when you first clone the repo.

You can do this in git. git update-index --assume-unchanged <file>

pseudorandom name
May 6, 2007

That isn't what that's for, though, and may cause you problems later.

Comrade Gritty
Sep 19, 2011

This Machine Kills Fascists

pseudorandom name posted:

That isn't what that's for, though, and may cause you problems later.

Not sure how that isn't what it's for, the git update-index command is the command that is used to... update the index, which if you don't want a file to register as changed in the index, you tell the index not to track changes to it.

ufarn
May 30, 2009
I've made a branch, foo, with a bunch of changes from when I branched out from master a couple of weeks ago, so the difference between the two is likely to be huge.

As a result, a lot of files will be affected, and I want to make sure I am able to scrutinize all the affected files to resolve any conflicts after the two are merged to one.

On Windows or Ubuntu, what is the best way to view an intelligible representation of the changes and affected files, and what other precautions do you recommend, before I pull the trigger?

musclecoder
Oct 23, 2006

I'm all about meeting girls. I'm all about meeting guys.

ufarn posted:

I've made a branch, foo, with a bunch of changes from when I branched out from master a couple of weeks ago, so the difference between the two is likely to be huge.

As a result, a lot of files will be affected, and I want to make sure I am able to scrutinize all the affected files to resolve any conflicts after the two are merged to one.

On Windows or Ubuntu, what is the best way to view an intelligible representation of the changes and affected files, and what other precautions do you recommend, before I pull the trigger?

Without sound like an rear end, can I ask why it matters? Why not just do the merge and see what conflicts, fix those, and then commit them? I presume you're using git since you mentioned master as the mainline branch, and it (along with any decent VCS) will tell you the conflicts.

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.

ufarn
May 30, 2009

enki42 posted:

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.
Great tips/tricks!

I did, however, go back to change some things on master, so the pull request on branch_name will be a bit misleading, right? Unlike git diff master..branch_name, I take it this will be a diff between the last master commit, before I branched to branch_name, right?

In other words, if we say that I made the branch at master 1.0 and later updated master to 2.0, git diff master..branch_name will show the difference between:
* master 2.0 and branch_name

and the pull request will show the diff for:
* master 1.0 and branch_name

ufarn fucked around with this message at 04:05 on Mar 5, 2012

Zhentar
Sep 28, 2003

Brilliant Master Genius
I can't offer any git specific advice, but KDiff3 is a pretty good GUI diff program for looking at things.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


ufarn posted:

Great tips/tricks!

I did, however, go back to change some things on master, so the pull request on branch_name will be a bit misleading, right? Unlike git diff master..branch_name, I take it this will be a diff between the last master commit, before I branched to branch_name, right?

Wrong.

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.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Does anyone care to give their input on the big hosted services? I Googled some reviews but they all basically say 'hurr use github'

Bitbucket
Github
SourceForge
Google Code

<any others I don't know about>

I use svn at work but I've played around with git so I'm not committed to any certain system. I also wouldn't mind any recommendations for a free host that will allow you to keep a private repo. I assume you can make your repo read-only to the world, but what about projects you don't want anyone else to access? I may just setup git/svn on a VPS, and just back that up every night.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

Bob Morales posted:

Does anyone care to give their input on the big hosted services? I Googled some reviews but they all basically say 'hurr use github'

Bitbucket
Github
SourceForge
Google Code

<any others I don't know about>

I use svn at work but I've played around with git so I'm not committed to any certain system. I also wouldn't mind any recommendations for a free host that will allow you to keep a private repo. I assume you can make your repo read-only to the world, but what about projects you don't want anyone else to access? I may just setup git/svn on a VPS, and just back that up every night.

If private repos are important, use bitbucket. If you want other people to see and participate in the development of your project, use github.

It's not so much "hurr, use github" as "github is better than everything else in every way". The one exception is that bitbucket gives you unlimited private repos. And they let you use git anyway, so it's not a huge investment if you later decide that github is the tool for you.

Otherwise, what do you want to hear about them? They're ugly and don't have the features or the userbase that github does.

Mithaldu
Sep 25, 2007

Let's cuddle. :3:

Bob Morales posted:

Does anyone care to give their input on the big hosted services? I Googled some reviews but they all basically say 'hurr use github'
The problem is that those that aren't github are:

1. old
2. built for old VCS

Github is the best because it's young and built for what is currently the best VCS. There's just no contest.

No Safe Word
Feb 26, 2005

Mithaldu posted:

The problem is that those that aren't github are:

1. old
2. built for old VCS

Github is the best because it's young and built for what is currently the best VCS. There's just no contest.

Bitbucket is younger and was built with mercurial in mind from the ground up :confused:

wwb
Aug 17, 2004

Totally concur with Sailor_Spoon. I generally look to bitbucket first then github. Github has a bit more cache and a social angle but thinking about how I discover open source projects it really don't matter where they are as long as the source is hosted somewhere public. I'm not going to go browse projects on github per-se.

PS: I should add I was just making the corporate "which DCVS host are you going with" decision the other month. Bitbucket won.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug
I liked the Wired article that likened Github to Facebook

Wired posted:

GitHub.com is best thought of as Facebook for geeks. Instead of uploading videos of your cat, you upload software. Anyone can comment on your code and add to it and build it into something better.

It's not that Github is technically superior but that everyone is on Github it has a network affect that makes Git and Github better. I would say for personal or open source software go with Github but for closed source software Bitbucket is a better choice (free for under 5).

ufarn
May 30, 2009

gariig posted:

I liked the Wired article that likened Github to Facebook


It's not that Github is technically superior but that everyone is on Github it has a network affect that makes Git and Github better. I would say for personal or open source software go with Github but for closed source software Bitbucket is a better choice (free for under 5).
They also put the article on GitHub, and I can't see anywhere else where it would get the activity and pull requests it got.

GitHub is probably the biggest darling of the tech industry right now, and it's so popular that it's like a digital CV for people. It makes it so much easier to show people what you've done and can do, and the great design facilitates this even more.

crazypenguin
Mar 9, 2005
nothing witty here, move along
fwiw, for my last project I went with google code. I think that might have been a mistake. (lol they recently just flat out removed the 'recent activity' thing from projects.)

I don't have anything to say about the others other than prefer bitbucket over google code. (Also, sourceforge is still a thing that exists?)

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

crazypenguin posted:

(Also, sourceforge is still a thing that exists?)

FileZilla, Boost, VLC, DOSBox, lots of stuff is hosted there. I always get pissed when a download link takes me to their ad-ridden, slow servers.

welcome to hell
Jun 9, 2006
SourceForge isn't a terrible choice for distributing software packages, but you'd be insane to use it for anything else.

Rescue Toaster
Mar 13, 2003
This is a little beyond the scope of just 'source control' but maybe someone can point me in the right direction.

I'm getting into later stages of a CS degree, and starting to work on more serious projects (in C#/C++/VS2010 and java/intellij). And I'll be starting to work on more small team projects.

At a minimum, I'd like to setup a small repository, but also...

I'm looking to do a lot of CUDA/OpenCL programming, and rather than spend $1500+ on some portable workstation laptop, I figure it must be possible to setup some kind of central build/debug server where I can load up one or two high end GPUs for a pittance compared to any real laptop. I know at least Team Foundation can do this, but it seems like it's more geared for automated unit testing and the like, not actual live step-by-step debugging and tracing. And short of constantly using remote desktop, I don't see any way to interact with the programs as they're running. And of course Team Foundation doesn't help with any java work I want to do. (I do have full MSDN and can get TF server for free.)

I guess the simplest is just remote into a normal machine running VS/IntelliJ that's also setup with source control, check out, build and run. But that seems really clunky. I've run VS through remote desktop before and it's painful.

Adbot
ADBOT LOVES YOU

Dromio
Oct 16, 2002
Sleeper

Rescue Toaster posted:

This is a little beyond the scope of just 'source control' but maybe someone can point me in the right direction.

I'm getting into later stages of a CS degree, and starting to work on more serious projects (in C#/C++/VS2010 and java/intellij). And I'll be starting to work on more small team projects.

At a minimum, I'd like to setup a small repository, but also...

I'm looking to do a lot of CUDA/OpenCL programming, and rather than spend $1500+ on some portable workstation laptop, I figure it must be possible to setup some kind of central build/debug server where I can load up one or two high end GPUs for a pittance compared to any real laptop. I know at least Team Foundation can do this, but it seems like it's more geared for automated unit testing and the like, not actual live step-by-step debugging and tracing. And short of constantly using remote desktop, I don't see any way to interact with the programs as they're running. And of course Team Foundation doesn't help with any java work I want to do. (I do have full MSDN and can get TF server for free.)

I guess the simplest is just remote into a normal machine running VS/IntelliJ that's also setup with source control, check out, build and run. But that seems really clunky. I've run VS through remote desktop before and it's painful.

You probably want a "Continuous Integration" system. Most simply, it can watch your source control repository for changes and do a new build whenever code is checked in. Of course there's a ton of flexibility in what else it can do.

I prefer TeamCity for this. It has a ton of flexibility while still being relatively easy to set up. It's free for small projects and teams.

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