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
Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Tequila Bob posted:

If I already know Mercurial and Darcs, should I take the time to learn Git? The posts here make Git seem complicated, but I would learn it if it has significant advantages over those other two.
I honestly didn't have any problem learning git. The only thing I repeatedly messed up was having to explicitly add changes to a changeset. However by the time I even touched git, I was competent in Unix shell scripting, a competence I had gained partly by writing very simple scripts to hack local feature branching on top of a centralized VCS.

Gazpacho fucked around with this message at 01:17 on Jul 15, 2013

Adbot
ADBOT LOVES YOU

Tequila Bob
Nov 2, 2011

IT'S HAL TIME, CHUMPS

Thermopyle posted:

If you need it then learn it. If you're curious then learn it. It has its pros and cons compared to other DVCS systems.

I'm not sure what kind of answer you're looking for.

Oh, I don't need to learn it. I didn't really need to learn Hg or Darcs either, but doing so has improved my workflow compared to SVN, etc. I just want to know what Git has that Hg/Darcs don't have, to make the effort to learn it worthwhile.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Tequila Bob posted:

Oh, I don't need to learn it. I didn't really need to learn Hg or Darcs either, but doing so has improved my workflow compared to SVN, etc. I just want to know what Git has that Hg/Darcs don't have, to make the effort to learn it worthwhile.

git has github which, if you want to remain employable, is practically a requirement now

if you already know hg/darcs a functional amount of git should only take you 15 minutes anyways

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
What are the options for change management between companies if they're NOT using DVCS, and rather on SVN or it's ilk? I'm contracting for a company that ends up in front-end/back-end dev setups with other companies, where our side provides html,css,js, and then the other company does integration.

In the past it's seemed like it goes alright as an initial deliverable, but then things get really messy once the change requests start piling up, and often html changes get communicated by email at that point here, which is pretty bad. Does SVN have a way to fork or do pull requests, or is the only expedient option to convince these guys into a DVCS (which will probably be git) as soon as possible.

Personally I use git for pretty much everything, but it's more about finding ways to wrap around their existing processes.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
If you have someone clueful on their end, you might be able to get them to run git-svn or something as a bridge between git and svn so that you can work remotely.

JawnV6
Jul 4, 2004

So hot ...

the talent deficit posted:

git has github which, if you want to remain employable, is practically a requirement now

Anyone have a swag at the actual percentage? Out of my professional circles, I think I know ~one guy with a github.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

JawnV6 posted:

Anyone have a swag at the actual percentage? Out of my professional circles, I think I know ~one guy with a github.

I can only think of one coworker (out of a dozen or so) that might not have an account. I would think it was very strange if I was interviewing someone and they didn't.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Volmarias posted:

If you have someone clueful on their end, you might be able to get them to run git-svn or something as a bridge between git and svn so that you can work remotely.

Righto, understood. I know another small dev team nearby managed to migrate a serious amount of work over to Git in about a week or two using git-svn, might be the way to start getting these guys to bridge the gap to DVCS. It's just proving a major blocker at the moment to their workflow.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Sailor_Spoon posted:

I can only think of one coworker (out of a dozen or so) that might not have an account. I would think it was very strange if I was interviewing someone and they didn't.

I have an account but only because of their "hello github" tutorial. I host my repo privately on my own hosting.

I can understand the allure of looking for people's public coding profiles, but if you do that you're pigeonholing your position to a guy that has the free time to write open source projects instead of someone with a life outside of work that isn't more work.

JawnV6
Jul 4, 2004

So hot ...

Sailor_Spoon posted:

I can only think of one coworker (out of a dozen or so) that might not have an account. I would think it was very strange if I was interviewing someone and they didn't.

Everyone at the old job, the half dozen resumes I've seen interviewing others at this one, and a few contractors I've worked with, nobody had it on their resume. There's plenty of proprietary software being written and professionals who do it that haven't made an account on a ~5 year old site. They claim to have 3 million users, I think that'd be a terrible ceiling on the estimate of software professionals.

Are you talking about junior people, <5 years experience? More web dev/interpreted languages instead of firmware or compiled?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Volmarias posted:

I can understand the allure of looking for people's public coding profiles, but if you do that you're pigeonholing your position to a guy that has the free time to write open source projects instead of someone with a life outside of work that isn't more work.

A certain type of person doesn't view coding outside of their job as "work". This type of person comes with a set of attributes that many employers would like.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

JawnV6 posted:

Everyone at the old job, the half dozen resumes I've seen interviewing others at this one, and a few contractors I've worked with, nobody had it on their resume. There's plenty of proprietary software being written and professionals who do it that haven't made an account on a ~5 year old site. They claim to have 3 million users, I think that'd be a terrible ceiling on the estimate of software professionals.

Are you talking about junior people, <5 years experience? More web dev/interpreted languages instead of firmware or compiled?

Yeah, I'm sorry, I didn't mean to come across as saying that everyone should have a bunch of projects that they work on in their free time. I certainly don't, my github is mostly just my dotfiles and a couple other projects that I've fixed small bugs for at work. That said, if I was evaluating someone as a potential coworker and they were like "oh, github, yeah, I've heard of that", I would take pause. I do webdev, mostly python and ruby. I'm sure that's a big part of it.

JawnV6
Jul 4, 2004

So hot ...

Thermopyle posted:

A certain type of person doesn't view coding outside of their job as "work". This type of person comes with a set of attributes that many employers would like.
Under 30, no family, still a bright eyed idealist.

Sailor_Spoon posted:

I do webdev, mostly python and ruby. I'm sure that's a big part of it.
There it is.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

JawnV6 posted:

Under 30, no family, still a bright eyed idealist.

I still code for fun all the time. I'm 31, have a girlfriend that lives with me (no kids though), and I'm as jaded and bitter as they come.

I don't contribute to github though, do I still count?

ExcessBLarg!
Sep 1, 2001

Sailor_Spoon posted:

I would think it was very strange if I was interviewing someone and they didn't.
I would think it was very strange (or maybe just unfortunate) if a potential employer expected my personal use of specific social services, be it GitHub, or even Facebook or something.

GitHub is just one way to develop a (public) portfolio of your work. Depending on the applied-for position and past experience, it may be résumé material, or it may be irrelevant. As an interviewer, I'm far more interested in hearing about your past experiences, particularly novel ones. If there's an accessible portfolio (public or private) that demonstrates your work, even better. I couldn't care if it was GitHub, Bit Bucket, private repositories, or whatever.

Now, not being aware of GitHub might be surprising, but depending on the position, quite possibly irrelevant.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

JawnV6 posted:

Under 30, no family, still a bright eyed idealist.

There it is.

I'm 35, married, with a child. Coding is what I do for fun.

However, if your generalization was correct, I'd say that's probably what most businesses are looking for.

edit: I realized something that makes me an outlier. Despite the fact that I wrote a lot of code between 10-14 years of age, I didn't code at all from that time until I was around 30...

And I take back what I said about "most businesses". I have no idea what most businesses want in a coder, but I would assign high probability to "Under 30, no family, bright-eyed idealists" being exactly what a lot of the exciting businesses are looking for.

Thermopyle fucked around with this message at 23:09 on Jul 17, 2013

Zhentar
Sep 28, 2003

Brilliant Master Genius
People who think programming is fun tend to be more interested in solving interesting programming problems than boring business problems. So they usually come up with ways to turn boring business problems into interesting programming problems. This can turn out well, but it can also be a pretty bad thing.


Edit: I'm a complete sucker. Most of my fun programming is owned by my employer, since it's spent working on code owned by my employer (Not the same code I work on for my day job, mind you).

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Zhentar posted:

People who think programming is fun tend to be more interested in solving interesting programming problems than boring business problems. So they usually come up with ways to turn boring business problems into interesting programming problems. This can turn out well, but it can also be a pretty bad thing.

It's usually a bad thing. You end up with the inner platform effect, because writing some code to serialize/deserialize XML documents is so boring. It's way more interesting to write a database-driven XML generation engine. Then you can make any XML document in the world, as long as you spend 3 weeks carefully inserting the correct rows, and you don't mind waiting 3 hours for it to generate a 100K XML file.

(If you can't tell, I'm really bitter about having to support that XML engine. I complain about it every chance I get)

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
I used to write code on my own for fun and profit, and now I have a toddler instead of free time. Sorry for not having a github account, better pass over my resume.

wolffenstein
Aug 2, 2002
 
Pork Pro
I have a relatively populated and active GitHub, and it hasn't helped much with my job search.

Tiax Rules All
Jul 22, 2007
You are but the grease for the wheels of his rule.
What are the ethics of creating a new repository to modify someone's code and take it in a direction that the creator isn't interested? The code's copyright is with The MIT License, so I think I should be in the clear as long as I keep the original creator's name and copyright notice in the license file. Are there any legal/ethical issues that I'm overlooking?

Nippashish
Nov 2, 2005

Let me see you dance!

Tiax Rules All posted:

What are the ethics of creating a new repository to modify someone's code and take it in a direction that the creator isn't interested? The code's copyright is with The MIT License

Explicitly allowing this is more or less the point of the MIT license.

ExcessBLarg!
Sep 1, 2001

Tiax Rules All posted:

What are the ethics of creating a new repository to modify someone's code and take it in a direction that the creator isn't interested?
Ethically, don't misrepresent the origin of the code or contributions by any contributor.

It's also highly preferable to preserve the revision history of the original project. It's not really an ethical issue, as much as it's more painful to deal with code that has an opaque history when trying to figure out why some part looks weird.

Tiax Rules All posted:

Are there any legal/ethical issues that I'm overlooking?
If you are going to retain some part of the original project's name, make sure there's no trademark concerns. If there is, you may be obligated to rename the project, e.g., RHEL vs. CentOS, Firefox vs. Iceweasel, etc.

If you're going to use this code for commercial purposes, it would be worth performing a copyright audit/assessment to ensure that copyright on the upstream code is accurate and all licenses are valid. Some folks play fast-and-loose here and think they can include or relicense code where they actually can't, and you can be held liable if you distribute code that's not entirely kosher here.

If nothing else, you should really read all the code at least once and note anything that's suspicious, like code that's obviously authored by someone else or clearly part of a different project that got copypastaed.

raminasi
Jan 25, 2005

a last drink with no ice

ToxicFrog posted:

It totally can; the command you're thinking of is git filter-branch. It rewrites history by running a shell command on every commit; make the command something like sed -r -i -e 's/<license key>/XXXXXXXXXXXX/' license.clj and then make sure you don't push the old version of the branch and there you go.

I've used it myself to retroactively remove copyrighted materials I was using for testing from a repo before putting it on github.

This is perfect! (But terrifying.) Unfortunately I'm not 100% confident that the key has always resided in the same location, so I'd like to have sed work on the whole codebase. Do you think that this would be tractable for a ~15kloc project? If so I'll go dig up some incantation to do that. (I guess you have to pipe find into sed? I don't do this kind of thing ever.)

And when this is done, I just force-push to all my remotes, right?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

GrumpyDoctor posted:

This is perfect! (But terrifying.) Unfortunately I'm not 100% confident that the key has always resided in the same location, so I'd like to have sed work on the whole codebase. Do you think that this would be tractable for a ~15kloc project? If so I'll go dig up some incantation to do that. (I guess you have to pipe find into sed? I don't do this kind of thing ever.)

And when this is done, I just force-push to all my remotes, right?
Running dos2unix on ~6k commits of ~100kloc each on a ramdisk took about 24 hours for me, although I managed to get that down to about 4 hours with some very dumb optimizations (after it turned out that I did it wrong the first time). Replacing is all .foo files would just be find . -name '*.foo' -exec sed -i '' 's/<key>/XXXX/g' {} \; (BSD find/sed syntax, so on Linux/msys there may be minor differences).

After rewriting all the commits you need to force-push, but keep in mind that force-pushing doesn't necessarily actually delete the old commits from the destination, so you may want to create an entirely new repo for the public version.

ToxicFrog
Apr 26, 2008


GrumpyDoctor posted:

This is perfect! (But terrifying.)

It's not quite as terrifying as it sounds; git "history rewrites" are non-destructive, in that they create a new, parallel history and leave the original commits intact - so if something goes wrong you can use the reflog to recover the previous state and try again.

quote:

Unfortunately I'm not 100% confident that the key has always resided in the same location, so I'd like to have sed work on the whole codebase. Do you think that this would be tractable for a ~15kloc project? If so I'll go dig up some incantation to do that. (I guess you have to pipe find into sed? I don't do this kind of thing ever.)

You'd probably want find -exec, say something like:

code:
find . -name '*.clj' -or -name '*.lua' -exec sed -i 's/<key>/XXXX/g' '{}' '+'
That finds all files with the extension .clj or .lua, and runs sed on them to edit them in-place (-i) and replace <key> with XXXX. The '{}' is replaced with a list of found files. The '+' tells find to replace the '{}' with a list and run sed on as many files as possible (whereas ';', as in Plorkyeran's example, will run one sed per file and may be slower).

raminasi
Jan 25, 2005

a last drink with no ice

ToxicFrog posted:

It's not quite as terrifying as it sounds; git "history rewrites" are non-destructive, in that they create a new, parallel history and leave the original commits intact - so if something goes wrong you can use the reflog to recover the previous state and try again.

Well that's good, but the downside is that I'm trying to do a destructive rewrite. It's my understanding that the forced-pushed branch will still have somewhere all the stuff I'm trying to get rid of, but cloning the repository won't actually retrieve it. Is this correct? I think I can live with it.

e: Okay now I've got a problem figuring out the proper quotation and escaping. So far I've got git filter-branch --commit-filter "find . -name '*.cpp' -or -name '*.h' -exec sed -i 's/REAL KEY/DUMMY KEY/g' '{}' '+'", but REAL KEY has the ' character in it. How should I spell this command?

raminasi fucked around with this message at 22:34 on Jul 19, 2013

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Use a tree filter to rewrite the source files. Commit filters are some kind of advanced-advanced thing. Can't help you with the quoting thing, except to suggest that you use \" around your sed expression instead of '

e: Removed potentially broken filter

Gazpacho fucked around with this message at 05:15 on Jul 20, 2013

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Putting the rewrite command in a file and then just doing git filter-branch --commit-filter fix.sh will probably do good things for your sanity.

raminasi
Jan 25, 2005

a last drink with no ice

Plorkyeran posted:

Putting the rewrite command in a file and then just doing git filter-branch --commit-filter fix.sh will probably do good things for your sanity.

:doh: Of course. But,


Gazpacho posted:

Use a tree filter to rewrite the source files. Commit filters are some kind of advanced-advanced thing. Can't help you with the quoting thing, except to suggest that you use \" around your sed expression instead of '

e: Removed potentially broken filter

which kind of filter should I use?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I know you can use a tree filter to rewrite source files because I've used them. The interface you have to implement for a tree filter is simple: the current working directory contains files for you to modify, and you modify them. The interface for a commit filter is more complex.

raminasi
Jan 25, 2005

a last drink with no ice
You guys are being super helpful, and I'm sorry that I keep coming back with questions, but I can't get the exec to work. Even this simple version:
code:
$ find . -exec sed -i "s/key/replacement/g" '{}' '+'
find: missing argument to `-exec'
Googling has indicated that the problem has to do with the escaping of the terminators or something, but I've tried a bunch of combinations of single-quoting and backslashing on the {} and the + and none of them work. (I haven't tried the semicolon versions because I think the concatenation function or whatever is going to be important for what I'm doing.)

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

GrumpyDoctor posted:

You guys are being super helpful, and I'm sorry that I keep coming back with questions, but I can't get the exec to work. Even this simple version:
code:
$ find . -exec sed -i "s/key/replacement/g" '{}' '+'
find: missing argument to `-exec'
Googling has indicated that the problem has to do with the escaping of the terminators or something, but I've tried a bunch of combinations of single-quoting and backslashing on the {} and the + and none of them work. (I haven't tried the semicolon versions because I think the concatenation function or whatever is going to be important for what I'm doing.)

code:
/tmp/test$ echo key >file
/tmp/test$ find . -type f -exec sed -i 's/key/replacement/g' {} +
/tmp/test$ cat file
replacement
Works for me on Ubuntu, -type f was just so that it wouldn't complain
about running sed on a directory.

The only thing I can think of that would cause issue is if your version
of find doesn't support '+', and even busybox's find has that.

If find doesn't have '+', then you could run this instead

code:
$ find . -print0 | xargs -0 sed -i 's/key/replacement'

raminasi
Jan 25, 2005

a last drink with no ice
Okay, I got it chugging along. It's emitting a billion LF/CRLF replacement warnings (I'm on Windows) but whatever. I'm crossing my fingers! Thanks for everyone's help, and I hope I don't need any more.

e: Yep, there was a problem. The git filter-branch failed with:
Rewrite 9e115dd2bff765a76a68d8f5ba2d54126418fa62 (147/779)sed: no input files

I tracked that commit down, and it's empty. It has no files. I have no idea how that happens, but it did, and sed didn't like it. (The commit message indicated it was a merge of some sort.) What's my best option here?

raminasi fucked around with this message at 20:52 on Jul 22, 2013

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

GrumpyDoctor posted:

I tracked that commit down, and it's empty. It has no files. I have no idea how that happens, but it did, and sed didn't like it. (The commit message indicated it was a merge of some sort.) What's my best option here?

GNU xargs has the -r option for this reason, it won't run sed unless it gets at least one file.

Given your find didn't have +, I'm not so confident that your xargs will have -r.

You could fool it by always passing another file to the sed command, so it becomes find . | xargs sed -i "s/key/replacement/g" "C:\absolute\path\to\an\existing\file".

If you can't get it to work by stringing shell commands together, then writing something in C# might be the least painful solution.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

GrumpyDoctor posted:

Okay, I got it chugging along. It's emitting a billion LF/CRLF replacement warnings (I'm on Windows)
sed -b

raminasi
Jan 25, 2005

a last drink with no ice
Okay, it looks like it worked! (I had to learn about doing it to the tags as well.) Thanks for all your help!

Don Music
Jun 20, 2008
So, I'm a Software Engineering student, and for my Agile Software Development unit this semester we have to take an existing project, made in Java with servlets and built by Ant and create an add-on for it.

I'm kind of at a loss as to what to do for version control - I've only ever used GitHub for my own code - never on projects.

The 'easy' solution as far as I could tell would be to create a Git repository on a Ubuntu Server VPS that I have (where I plan on hosting the project itself)..But my project team members want to use Team Foundation Server due to it's built in Agile tools (We get marked on how well we work with the Agile methodology, so it's relatively important). Team Foundation Server is windows only though, so it seems like running TFS separate to the server where we will be hosting the project would be quite hard. I've been doing a bit of reading on a CI tool called 'Jenkins' which I could set up on my server, but in general I'm just pretty in over my head here.

Can anyone point me in the right direction for version control for a project like this?

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

Don Music posted:

So, I'm a Software Engineering student, and for my Agile Software Development unit this semester we have to take an existing project, made in Java with servlets and built by Ant and create an add-on for it.

I'm kind of at a loss as to what to do for version control - I've only ever used GitHub for my own code - never on projects.

The 'easy' solution as far as I could tell would be to create a Git repository on a Ubuntu Server VPS that I have (where I plan on hosting the project itself)..But my project team members want to use Team Foundation Server due to it's built in Agile tools (We get marked on how well we work with the Agile methodology, so it's relatively important). Team Foundation Server is windows only though, so it seems like running TFS separate to the server where we will be hosting the project would be quite hard. I've been doing a bit of reading on a CI tool called 'Jenkins' which I could set up on my server, but in general I'm just pretty in over my head here.

Can anyone point me in the right direction for version control for a project like this?

You can use the hosted TFS for free. The web page says up to 5 people are free but they haven't started charging for the service yet. You can even use git with it and any CI that uses git.

gariig fucked around with this message at 01:20 on Jul 26, 2013

Adbot
ADBOT LOVES YOU

wwb
Aug 17, 2004

I have never heard of anyone using TFS on non .NET projects though the changes have happened and it might be in the art of the possible. I really don't see how it would support ANT though.

I would not touch it with a ten foot pole and I'd probably fail anyone taking my agile course for claiming it isn't bloated managerware. But I'm old school and dogmatic like that.

I would also fail you for doing something dumb like hosting your own SCM in 2013.

I would use Bitbucket as it supports git or hg, lets you have private repositories and has all the wiki / issue tracking features one could need. You can easily integrate that (or github for that matter) with jenkins and stay very agile and probably pick up all the points possible for that stage.

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