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
My Rhythmic Crotch
Jan 13, 2011

The version control chat is exactly what I need to be reading right now. When we come back from the holiday break, I'm training our little team about version control. The "daily dump" analogy may make it onto a powerpoint slide.

Adbot
ADBOT LOVES YOU

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance

EAT THE EGGS RICOLA posted:

Or when someone tells you to hard reset your local repo, you should maybe just consider that it's going to blow away everything? It's not like Horatio ran the command, he gave it to this person, who said "okay that seems reasonable", knowing that they only commit work once a week.

I feel responsible not because I physically typed the command but because this guy knows nothing about git and would have typed anything I told him to (despite the fact that he's been "using" git for years and I just started learning it a year ago).

So here's the thing, he doesn't know what's happened yet. Pushing out my fix was the last thing we did Friday before leaving and I had that moment of dawning horror on the way home when I remembered he's allergic to regular commits. He doesn't know yet that the work is lost. Do I own up to it or do I just say "gosh that's awful, don't know how that happened, let me help you recreate your changes and by the way here's a tutorial on how to actually use git"?

Brain Candy
May 18, 2006

HORATIO HORNBLOWER posted:

I feel responsible not because I physically typed the command but because this guy knows nothing about git and would have typed anything I told him to (despite the fact that he's been "using" git for years and I just started learning it a year ago).

So here's the thing, he doesn't know what's happened yet. Pushing out my fix was the last thing we did Friday before leaving and I had that moment of dawning horror on the way home when I remembered he's allergic to regular commits. He doesn't know yet that the work is lost. Do I own up to it or do I just say "gosh that's awful, don't know how that happened, let me help you recreate your changes and by the way here's a tutorial on how to actually use git"?

Stop, no, don't. You are not responsible for your incompetent coworker. You can't make somebody learn who clearly doesn't care.

RICHUNCLEPENNYBAGS
Dec 21, 2010
Since everyone is talking about git, is there a GUI client that actually has any of the features? The Visual Studio 2013 integration and the Github client both only offer the absolute basics but I don't really want to devote a whole lot of time to learning git commands on a sample and I certainly don't want to test out commands I don't really understand on my actual work

EAT THE EGGS RICOLA
May 29, 2008

HORATIO HORNBLOWER posted:

I feel responsible not because I physically typed the command but because this guy knows nothing about git and would have typed anything I told him to (despite the fact that he's been "using" git for years and I just started learning it a year ago).

So here's the thing, he doesn't know what's happened yet. Pushing out my fix was the last thing we did Friday before leaving and I had that moment of dawning horror on the way home when I remembered he's allergic to regular commits. He doesn't know yet that the work is lost. Do I own up to it or do I just say "gosh that's awful, don't know how that happened, let me help you recreate your changes and by the way here's a tutorial on how to actually use git"?

I would probably go with "well yeah that's what 'reset --hard' does what did you expect it's right in the name, aren't you committing multiple times a day like you're supposed to?"

Or maybe "Oh that sucks a bit but at least your last commit was just a couple hours earlier at worst"

brosmike
Jun 26, 2009

HORATIO HORNBLOWER posted:

I feel responsible not because I physically typed the command but because this guy knows nothing about git and would have typed anything I told him to (despite the fact that he's been "using" git for years and I just started learning it a year ago).

So here's the thing, he doesn't know what's happened yet. Pushing out my fix was the last thing we did Friday before leaving and I had that moment of dawning horror on the way home when I remembered he's allergic to regular commits. He doesn't know yet that the work is lost. Do I own up to it or do I just say "gosh that's awful, don't know how that happened, let me help you recreate your changes and by the way here's a tutorial on how to actually use git"?

Though his lovely backup/commit practices are the real issue here, you should still own up to what's really happened. If you don't, there's basically two possible outcomes:

  • He figures it out and blames you anyway
  • He doesn't figure it out and blames Git itself

If the first happens, do you think it will be better for you to have not owned up? (I bet "no")

If the second happens, do you think he's more likely to say "Oh, whoops, I guess I should spend some time learning this tool" or "What the hell, now I don't trust Git at all, better figure out some backwards-rear end system that keeps my in progress code outside of a local repository so this can't happen again"? If the guy were willing to learn his tools you wouldn't be here in the first place. I've seen the second one happen twice in my workplace and it sucks trying to work with people doing that.

Yes, not being willing to learn the tools you're using is The Real Coding Horror™, but you won't be able to fix that problem in your co-workers (besides by switching jobs) so you should at least go with the path that makes them easier for you to work with in the future (hint, it's not the one that involves a backwards-rear end manual-copying-based idea of a "version control system").

Explain what happened and how to make it not a problem in the future, or he's as likely as not to make up a much more horrifying way to make it "not a problem" in the future.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Jewel posted:

Oh man these are neat. I really gotta learn about git properly one day but it's hard to learn without a codebase and someone to help, so I probably won't get a chance to until I get a job/internship. I've mostly used svn/perforce to this day so I know about most stuff, just not the advanced ones like those.

The thing is that branches aren't really anything, they're just pointers to other commits, on wheels. git has a fundamentally different model from other VCSes and it's really cool and useful.

https://people.gnome.org/~federico/news-2008-11.html#pushing-and-pulling-with-git-1

QuarkJets
Sep 8, 2008

EAT THE EGGS RICOLA posted:

I would probably go with "well yeah that's what 'reset --hard' does what did you expect it's right in the name, aren't you committing multiple times a day like you're supposed to?"

Or maybe "Oh that sucks a bit but at least your last commit was just a couple hours earlier at worst"

Horatio is being a non-lovely empathetic human being. Giving him smarmy comments to make back at his coworkers isn't going to help him or his relationship with his coworker. You sound like an unpleasant person to work with

Horatio, just apologize and tell your coworker that they should be committing much more often.

e: Basically I agree with brosmike

QuarkJets fucked around with this message at 19:26 on Dec 28, 2013

nielsm
Jun 1, 2009



RICHUNCLEPENNYBAGS posted:

Since everyone is talking about git, is there a GUI client that actually has any of the features? The Visual Studio 2013 integration and the Github client both only offer the absolute basics but I don't really want to devote a whole lot of time to learning git commands on a sample and I certainly don't want to test out commands I don't really understand on my actual work

Atlassian SourceTree is pretty good. It's not perfect, and you will have to go command-line for some things, but it certainly helped me understand git better, and I think it gives a quite clear overview of what's actually happening in the repository.

RICHUNCLEPENNYBAGS
Dec 21, 2010

Brain Candy posted:

Stop, no, don't. You are not responsible for your incompetent coworker. You can't make somebody learn who clearly doesn't care.

I think you are at least in part responsible for the effects of commands you type into your co-worker's computer, even though, yes, he shouldn't have put himself in that position.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Seconding SourceTree. It's nice to be able to actually "see" the repository, and it has GUI interfaces to most of the tools of git.

That coworker's situation does suck, hopefully at least he remembers to tell people when he has large uncommitted work, or at least does git stash before anything potentially dangerous to uncommitted changes.

carry on then fucked around with this message at 20:16 on Dec 28, 2013

Brain Candy
May 18, 2006

RICHUNCLEPENNYBAGS posted:

I think you are at least in part responsible for the effects of commands you type into your co-worker's computer, even though, yes, he shouldn't have put himself in that position.

That might be true if that were what happened. Instead, we have somebody seriously stressing about giving good info based on completely reasonable but wrong assumptions. This is the definition of "poo poo happens".

If the guy asks wtf happened and wants make sure it doesn't happen again, sure, help him out. Should Horatio go to that dumb motherfucker hat in hand for making the mistake of assuming he was a professional?

Unless Horatio is actually in some position of authority, (hint, he's not or the policy would be to always be committing) trying to tell someone else how to do their job is just going to cause resentment.

EAT THE EGGS RICOLA
May 29, 2008

QuarkJets posted:

Horatio is being a non-lovely empathetic human being. Giving him smarmy comments to make back at his coworkers isn't going to help him or his relationship with his coworker. You sound like an unpleasant person to work with

Horatio, just apologize and tell your coworker that they should be committing much more often.

e: Basically I agree with brosmike

I was being mostly flippant, but this person hosed up, not Horatio. He should be helpful, but his coworker needs to learn how to do his job properly.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

He does, but the usual goon strategy of "publicly chastise with pithy comments" doesn't exactly foster a happy work environment. What I'd do is just mention that it occurred to me that uncommitted changes might have been lost only after performing the operation, and that I don't know how much was uncommitted. If he lost a lot, hopefully it'll be a good learning experience to commit often since, like someone said earlier, what would be different if his HDD had died instead? Accidents happen, work is lost, but hopefully he learns to commit more often for his own good. If not, this'll just keep happening.

QuarkJets
Sep 8, 2008

EAT THE EGGS RICOLA posted:

I was being mostly flippant, but this person hosed up, not Horatio. He should be helpful, but his coworker needs to learn how to do his job properly.

I definitely agree with that. If you find a coworker who's committing weekly, talk to them about the importance of committing much more frequently than that.

Plorkyeran
Mar 22, 2007

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

QuarkJets posted:

I definitely agree with that. If you find a coworker who's committing weekly, talk to them about the importance of committing much more frequently than that.
No, I think the correct solution is to be as passive-aggressive as possible and go out of your way to introduce conflicts with whatever he's working on so that the only way he can ever merge cleanly is to do it too frequently for you to interfere with.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Braaam posted:

Rather than squashing, consider an interactive rebase as a middle-ground between the two (that is, between one giant squash commit and lots of tiny broken commits). You can use it to squash arbitrary commits into each other, re-order commits, remove commits entirely, and so on.

My last step before merging a topic branch is always to `rebase -i` it, to make sure it's nice and tidy before it joins the main project history.

Here's a useful Git alias for rebasing the entire branch that you're currently on, assuming that your stable branch is "master":

code:
rebase-branch = "!git rebase -i `git merge-base master HEAD`"

What is the difference between what you do versus say: git rebase origin/master (obviously assuming origin/master is what you're trying to rebase on top of)?

ewe2
Jul 1, 2009

Shouldn't someone be managing the codebase to minimize these issues? I would have thought using a distributed VCS like git would mandate such an organizer for larger/mission-critical projects (like git itself)? Or is that an outmoded practice and we're assuming coders do all their own work now?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
There are two distinct concepts involved: having someone vet the code being merged into master, and having a dedicated person actually doing the merge. The first is still very important for anything large, whether it take the form of formal code reviews or a just person (or group of people) that has to sign off on changes, but the second is a sign that your process is hosed (if merging is difficult, you're using bad tools or doing it too rarely).

Volmarias
Dec 31, 2002

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

ewe2 posted:

Shouldn't someone be managing the codebase to minimize these issues? I would have thought using a distributed VCS like git would mandate such an organizer for larger/mission-critical projects (like git itself)? Or is that an outmoded practice and we're assuming coders do all their own work now?

See http://git-scm.com/book/en/Distributed-Git-Distributed-Workflows. You don't need a gatekeeper our lieutenants or a benevolent (albeit cranky and foul mouthed) dictator for your project, it just depends on the scope and scale of what you're doing.

I would consider it a strong smell if your organization has someone dedicated to merging code.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
Excuse me while I rag on second-system C++ for a moment:

http://www.rust-lang.org/ posted:

Rust is a curly-brace, block-structured expression language.
…yesss, the first, most important thing I need to know about a programming language is that it uses curly braces.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
That does seem to be the single most important factor in picking a language for a lot of programmers.

Thermopyle
Jul 1, 2003

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

nielsm posted:

Atlassian SourceTree is pretty good. It's not perfect, and you will have to go command-line for some things, but it certainly helped me understand git better, and I think it gives a quite clear overview of what's actually happening in the repository.

This reminded me that now that I'm back on Windows as my main OS, I finally want to try out SourceTree. Then I realize I still do all my development on a linux VM. :/

I guess I could share my development folder on the VM with the Windows host, but that seems like it might be an invitation for some disaster...but I'm not sure about that.

necrotic
Aug 2, 2005
I owe my brother big time for this!

Strong Sauce posted:

What is the difference between what you do versus say: git rebase origin/master (obviously assuming origin/master is what you're trying to rebase on top of)?

The difference is the alias will automatically pick the correct parent branch to rebase against. Removes the need to remember what you branched off of.

Braaam posted:


My last step before merging a topic branch is always to `rebase -i` it, to make sure it's nice and tidy before it joins the main project history.


I so wish this was more common. I try to hammer it into my coworkers (given a few "lightning" talks during some of our lunch-n-learns and other internal meetings) but it never works. And it's bit us in the rear end with several bisects when I get to go "see if we had all been rebasing this would have been easy". Still no dice.

Steve French
Sep 8, 2003

necrotic posted:

The difference is the alias will automatically pick the correct parent branch to rebase against. Removes the need to remember what you branched off of.

No, that's not true. The command that he gave will just allow you to make edits to the string of changes you've to the current working branch (edit, squash, delete), but will keep the same merge-base.

Just doing a rebase on master will actually rebase the commits.

If you have:

pre:
D F
| |
C E
|/
B
|
A
where master points to D and the current branch points to F, and then do the command given above with the merge-base, the merge-base command finds the merge-base between D and F (B) and rebases on that. So if you run that and squash E and F together into G, you get:

pre:
D
|
C G
|/
B
|
A
but if instead you just 'git rebase master' and do the same thing, the result is:

pre:
G
|
D
|
C
|
B
|
A

Vanadium
Jan 8, 2005

Mustach posted:

Excuse me while I rag on second-system C++ for a moment:

…yesss, the first, most important thing I need to know about a programming language is that it uses curly braces.

It's a bunch of ML'ers going "Look, we even put in the loving braces, please give us a chance, all you mainstream programmers".

NFX
Jun 2, 2008

Fun Shoe
Regarding git GUIs: I've been using Tortoisegit for a while now, and it seems pretty good to me. Sure, it doesn't really integrate with an IDE, but neither do the command line tools.

RICHUNCLEPENNYBAGS
Dec 21, 2010

Brain Candy posted:

That might be true if that were what happened. Instead, we have somebody seriously stressing about giving good info based on completely reasonable but wrong assumptions. This is the definition of "poo poo happens".

If the guy asks wtf happened and wants make sure it doesn't happen again, sure, help him out. Should Horatio go to that dumb motherfucker hat in hand for making the mistake of assuming he was a professional?

Unless Horatio is actually in some position of authority, (hint, he's not or the policy would be to always be committing) trying to tell someone else how to do their job is just going to cause resentment.

quote:

I feel responsible not because I physically typed the command but because this guy knows nothing about git and would have typed anything I told him to (despite the fact that he's been "using" git for years and I just started learning it a year ago).

I used to just do SA work and while it was our policy that we wouldn't guarantee any data that wasn't on a network drive but I'd still at least say "hey, sorry I lost your stuff" if I deleted someone's improperly-stored work. I mean you don't need to grovel on your hands and knees or anything but come on.

necrotic
Aug 2, 2005
I owe my brother big time for this!

Steve French posted:

stuff about rebase

Err, yeah. For some reason I thought merge-based worked differently.

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance
Yeah I'm definitely gonna have a frank discussion with the guy and say "look, here's what I think happened, I'm really sorry, let's work together to fix it and make sure this doesn't happen again." I don't think I could live with myself otherwise. Thanks for the advice guys. It helps that a glimmer of hope occurred to me this morning. There may be a WAR file on our staging server with his changes on it. I doubt I could be so lucky that he exported it with source but if we can get the JSPs and JavaScript out of it at least that's something.

On the subject of git GUIs, I'm of the belief that they can be helpful to visualize the branches and the overall change history but none of them really expose the full power of git. If you don't learn the commands you haven't learned git. I think that was part of the problem here. All of our other team members use a GUI exclusively and don't know how to do much besides push and pull. They don't understand stashing, they don't understand branching, and so it's really no surprise that they only understand the necessity of committing in terms of being able to push to the remote so the build machine can churn out a WAR.

xtal
Jan 9, 2011

by Fluffdaddy

Mustach posted:

Excuse me while I rag on second-system C++ for a moment:

…yesss, the first, most important thing I need to know about a programming language is that it uses curly braces.

You're joking, but the biggest reason I don't use Rust is because its if statement syntax has braces but not parentheses. I just can't handle that.

shrughes
Oct 11, 2008

(call/cc call/cc)
There's nothing stopping you from adding parentheses, right?

ToxicFrog
Apr 26, 2008


Mustach posted:

Excuse me while I rag on second-system C++ for a moment:

…yesss, the first, most important thing I need to know about a programming language is that it uses curly braces.

Considering how many times I've seen people express unwillingness to use {Inform 7, Scheme, Lua, Python} because it doesn't have curly braces (and is thus either "too different from what they're used to" or "clearly not a real programming language"), I'm not sure I blame them. There seems to be a depressingly large population of purported programmers who use the presence or absence of curly braces as the deciding factor in whether to check out a language or not.

(On the other hand, do you really want those people using your language and thus posting on your mailing list and bug tracker and visiting your IRC channel?)

shrughes
Oct 11, 2008

(call/cc call/cc)
Telling people that it's a curly-brace language is reasonable and informative, it's not just the fact that curly braces are used but it also communicates the sort of coding style and control flow the language uses, with statements and loops and conditionals, how variables come into scope and how long they stay in scope, and that it's not some big departure into functional programming la-la land.

gonadic io
Feb 16, 2011

>>=
Perhaps I'm a little biased here but why not just let people choose? Why force yourself to be on one side or the other of a polarising issue?
code:
do {putStrLn "Hello "; putStrLn "world!"}

do putStrLn "Hello "
   putStrLn "world!"

do {
    putStrLn "Hello ";
    putStrLn "world!"
}
are all identical in Haskell. The two styles are entirely equivalent and either can be used anywhere the other one can. If you want your shop to have consistent code style then just mandate people use one or the other like you would an indentation style.

e:

shrughes posted:

it's a curly-brace language [...] it's not some big departure into functional programming la-la land.
lol

gonadic io fucked around with this message at 19:51 on Dec 29, 2013

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.

shrughes posted:

Telling people that it's a curly-brace language is reasonable and informative, it's not just the fact that curly braces are used but it also communicates the sort of coding style and control flow the language uses, with statements and loops and conditionals, how variables come into scope and how long they stay in scope, and that it's not some big departure into functional programming la-la land.
I'm going to create a lisp that uses curly braces instead of parentheses and spend millions of dollars marketing it, just to gently caress with this

Eleeleth
Jun 21, 2009

Damn, that is one suave eel.
A friend of mine got some source code from the outsourced team. The .git folder was included. This is the entire commit log for the master branch of this 180 hour project:

code:
commit fa118f722495ecee9392098ef51c21367640eba7
Author: John Smith <MAC@MACMINI.local>
Date:   Thu Dec 12 15:38:41 2013 +0530

    test 123

commit 282f08ab4791574f0597859508d617e8bfe92e2a
Author: John Smith <MAC@MACMINI.local>
Date:   Thu Dec 12 13:50:04 2013 +0530

    Latest Code

commit 6025ac3ef5a02de932a3887995dc4a2dc93749f1
Author: John Smith <MAC@MACMINI.local>
Date:   Fri Nov 8 11:54:01 2013 +0530

    Initial Commit

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Eleeleth posted:

A friend of mine got some source code from the outsourced team. The .git folder was included. This is the entire commit log for the master branch of this 180 hour project:

code:
commit fa118f722495ecee9392098ef51c21367640eba7
Author: John Smith <MAC@MACMINI.local>
Date:   Thu Dec 12 15:38:41 2013 +0530

    test 123

commit 282f08ab4791574f0597859508d617e8bfe92e2a
Author: John Smith <MAC@MACMINI.local>
Date:   Thu Dec 12 13:50:04 2013 +0530

    Latest Code

commit 6025ac3ef5a02de932a3887995dc4a2dc93749f1
Author: John Smith <MAC@MACMINI.local>
Date:   Fri Nov 8 11:54:01 2013 +0530

    Initial Commit

It's possible they were using some other form of source control and only periodically synched everything with your Git repo.

shrughes
Oct 11, 2008

(call/cc call/cc)
Is the MAC@MACMINI.local real or is that anonymized?

Adbot
ADBOT LOVES YOU

Eleeleth
Jun 21, 2009

Damn, that is one suave eel.

shrughes posted:

Is the MAC@MACMINI.local real or is that anonymized?

That bit's real, and git was their only form of source control.

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