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.
 
  • Locked thread
rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Shaggar posted:

just use subversion.

Adbot
ADBOT LOVES YOU

suffix
Jul 27, 2013

Wheeee!

Space Whale posted:

The VAST majority of the time this is the case!

The issues with detached heads was I had a local copy of a branch and now I don't do that.

But I have a question and if you know GIT enough to help please help.

I had a bunch of poo poo I had to undo and it seemed smarter to just use my loving version control to go back to the version before I did work I have to undo. Boss says "hey you're new here and to git talk to me before doing stuff in git." We converse on the fact that git is great for merging and checking in but apparently sucks at actually doing version control. He recommends I manually delete the poo poo I put in and commit/push. I decide to actually go back with git and do some reading:

code:
>git reset --hard <hashGoesHere>
>git push -f origin <hashGoesHere>:<BranchNameHere>
This is unsafe and just eliminated the old commits. :q: whatever

I read that with revert you had to do poo poo like revert HEAD~(n) (for n commits back?) or call revert multiple times since it only works one commit at a time.

How do you ~safely~ (that is, if you were not just not your own babby dev branch and if you hosed up it would really suck) go back n commits?

How would you do this if branching was involved?

you use git revert to make new commits that revert the hosed commits
that way everyone can see that there was a hosed commit, that the hosed commit was reverted, and that the unfucked commit comes after the hosed one
when you reset and force push your branch you lose all that


NAME
git-revert - Revert some existing commits

SYNOPSIS
git revert [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<key-id>]] <commit>...
git revert --continue
git revert --quit
git revert --abort

DESCRIPTION
Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits
that record them. This requires your working tree to be clean (no modifications from the HEAD commit).

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

suffix posted:

you use git revert to make new commits that revert the hosed commits
that way everyone can see that there was a hosed commit, that the hosed commit was reverted, and that the unfucked commit comes after the hosed one
when you reset and force push your branch you lose all that


NAME
git-revert - Revert some existing commits

SYNOPSIS
git revert [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<key-id>]] <commit>...
git revert --continue
git revert --quit
git revert --abort

DESCRIPTION
Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits
that record them. This requires your working tree to be clean (no modifications from the HEAD commit).

gently caress, beaten.

what this guy said, git-revert to go back to an earlier state if you already pushed your commit earlier, for exactly the stated reason. The new commits allow people to see what happened, and the rollback. Some idiots try to janitor the history in this situation to make it look like it never happen but that is a one way ticket to pain town

Bloody
Mar 3, 2013

Shaggar posted:

just use subversion.

this

altho its annoying when i have to right-click -> clean up because i forgot to close the word document i am trying update over

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
all I know is that I spent was less time fussing around with version control when I used subversion

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
you must have never merged your code with anyone elses

Soricidus
Oct 21, 2010
freedom-hating statist shill

rotor posted:

all I know is that I spent was less time fussing around with version control when I used subversion

you probably aren't following a rigid git workflow. pretty much all the problems people have with git can be traced to this mistake.

subversion is so inflexible that you have no choice but to follow the single reasonable workflow it supports. git is so flexible that you can easily gently caress everything up if you don't discipline yourself.

kind of reminiscent of the difference between plangs (git) and java/c# (subversion) actually, except that java/c# are more powerful than plangs while git is more powerful than subversion

Shaggar
Apr 26, 2006
the only reasonable workflow in git makes it work the same as subversion and your idiot developers will always want to use the hosed up workflows if you give them the option so don't give them the option.

theadder
Dec 30, 2011


MononcQc posted:

Doesn't that at least force importers to hire people locally in the chain of production? That sounds like a okay-ish alternative for the country.

lol

MononcQc
May 29, 2007

I guess all electronics over there is like ikea then

Luigi Thirty
Apr 30, 2006

Emergency confection port.

insert tab ä into slot ð

Space Whale
Nov 6, 2014

Soricidus posted:

you probably aren't following a rigid git workflow. pretty much all the problems people have with git can be traced to this mistake.

subversion is so inflexible that you have no choice but to follow the single reasonable workflow it supports. git is so flexible that you can easily gently caress everything up if you don't discipline yourself.

kind of reminiscent of the difference between plangs (git) and java/c# (subversion) actually, except that java/c# are more powerful than plangs while git is more powerful than subversion

What is that rigid git workflow?

Also are there wrappers over git that force that?

AWWNAW
Dec 30, 2008

sourcetree

Space Whale
Nov 6, 2014

AWWNAW posted:

sourcetree

I could not figure out how to do that in sourcetree.

I could in the command line tho.

JewKiller 3000
Nov 28, 2006

by Lowtax

As a Millennial I posted:

ok yeah that changes things

we actually have a guy here who i don't think even graduated community college, started in support and does actual programming for customer solutions now. he smells like weed about 30% of the time.

who the hell would trust a programmer that didn't smoke pot

AWWNAW
Dec 30, 2008

JewKiller 3000 posted:

who the hell would trust a programmer that didn't smoke pot

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Shaggar posted:

the only reasonable workflow in git makes it work the same as subversion

I know "shaggar was right" is kind of cliche but, well,

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

rotor posted:

I know "shaggar was right" is kind of cliche but, well,

except git can merge a branch without loving it up completely

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

bobbilljim posted:

you must have never merged your code with anyone elses

subversion merges are only harder because conflicts are per-file. so really the only extra work is finding a decent merge tool that automerges line by line unless it can't.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

quote:

Web developer needed following technologies knowledge are PHP, MySQL, HTML,CSS,SASS,JavaScript, JQUERY and others to make a good web application and database. Minimum 5 years experience, need reference projects and we will verify, No Day Dreamers that know theory but don't have the practice (I REPEAT IF YOU DON'T KNOW, DON'T WASTE MY OR YOUR TIME). This project is a contract of 6 months to complete Phase 1 of application website. Website has 3 Phases if we like developer work we will extend the contract that will take over 2 years. This project is a Freelance rather than employment and developer will receive a 1099. If you haven't completed a good Database website on your own don't even bother calling. This is not for university graduates, is for people that have completed projects from beginning to end without any teams to support them. I will be asking to name your price per hour and I will need to see your work as reference. Email me a resume and I will contact you.

tempted to reply to this with some obscene number for lols

Workaday Wizard
Oct 23, 2009

by Pragmatica

Crosscontaminant
Jan 18, 2007

Space Whale posted:

What is that rigid git workflow?
I've heard good things about git flow

Shaggar
Apr 26, 2006

rotor posted:

subversion merges are only harder because conflicts are per-file. so really the only extra work is finding a decent merge tool that automerges line by line unless it can't.

conflicts are mostly caused by bad design or project planning.

triple sulk
Sep 17, 2014



Crosscontaminant posted:

I've heard good things about git flow

Yes, let's make my already complicated vcs even more complicated by putting another layer of custom commands on top of it based on one guy's perception of how a workflow should be. Also the code for it hasn't been updated in two years even though there are 133 issues listed in the repo.

Notorious b.s.d.
Jan 25, 2003

by Reene

JewKiller 3000 posted:

who the hell would trust a programmer that didn't smoke pot

do that at home

pls don't smell like weed at work

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Crosscontaminant posted:

I've heard good things about git flow

it's good op

Crosscontaminant
Jan 18, 2007

triple sulk posted:

Also the code for it hasn't been updated in two years even though there are 133 issues listed in the repo.
yeah, the original is dead. use the avh fork which is actually maintained.

as for complexity, :shrug: I prefer mercurial anyway

Notorious b.s.d.
Jan 25, 2003

by Reene

Crosscontaminant posted:

as for complexity, :shrug: I prefer mercurial anyway

at this point git is the standard

mercurial has a vastly better UI but nobody cares. that war is over

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
just use sourcetree and don't be dumb

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Blinkz0rz posted:

just use src, src_new, src_useme and don't be dumb

pram
Jun 10, 2001
your revision control software is a piece of poo poo

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

pram posted:

your revision control software is a piece of poo poo

if it was up to me this would be the title of yospos

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

it's about ethics in revision control

theadder
Dec 30, 2011


Subjunctive posted:

it's about ethics in revision control

make this bannable

Luigi Thirty
Apr 30, 2006

Emergency confection port.

theadder posted:

make this bannable

nice job enforcing the gitocracy

Bloody
Mar 3, 2013

It's about ethics in *burp* *faaaaaaartz*

Soricidus
Oct 21, 2010
freedom-hating statist shill

Bloody posted:

It's about methane in *burp* *faaaaaaartz*

comedyblissoption
Mar 15, 2006

SVN is so intolerably bad at merging branches that the standard SVN workflow is to not branch. Instead the preferred strategy is to merge a bunch of half-baked and incomplete commits in with everyone else's half-baked and incomplete commits.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

comedyblissoption posted:

SVN is so intolerably bad at merging branches that the standard SVN workflow is to not branch. Instead the preferred strategy is to merge a bunch of half-baked and incomplete commits in with everyone else's half-baked and incomplete commits.

yeah svn basically discourages branching or merging.

Adbot
ADBOT LOVES YOU

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

comedyblissoption posted:

SVN is so intolerably bad at merging branches that the standard SVN workflow is to not branch. Instead the preferred strategy is to merge a bunch of half-baked and incomplete commits in with everyone else's half-baked and incomplete commits.

people say this and I'm generally pretty baffled. I worked for years using svn and always used a feature branch that got merged back to trunk when it was done. SVN merging is not any harder than git if you have a decent diff tool that will automerge files for you. What you have left is the same conflicts that git would have.

  • Locked thread