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
PleasureKevin
Jan 2, 2011

hey, here is my dumb post in yospos about this

but to paraphrase, i have 3 branches of a web project that are wildly different. my client has wanted to hold back tonnes and tonnes of work.now they want just a few features pushed to the master/live branch.

i've been doing this pretty well for a while, but this time there's at least 25 commits to cherry-pick and 70 insertions. and so much has changed in the architecture of the app that i'll probably have to go find a dozen more changes that those commits depend on. i'll have to go and carefully choose every insertion and if i get just one thing wrong then the whole thing won't work and i'll have to start over, or do a bunch of hot fixes. it also doesn't help that we have no active users on the site so all the overhead and precaution seems useless and we should really just push all our features live since it's locked behind a beta key system anyway.

my question is, am i a big whiny baby and this is just normal developer job stuff, or is this like impossible?

Adbot
ADBOT LOVES YOU

wolffenstein
Aug 2, 2002
 
Pork Pro

Thermopyle posted:

I'm completely unfamiliar with SVN, but an application I use distributes itself via SVN (lol).

I made some changes to a couple of files that I want to just discard and get from SVN again. I don't want to overwrite changes I've made elsewhere in the whole project, just these two files that are in the same subdirectory.

How do I do this?

svn revert file1 file2

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

PleasureKevin posted:

hey, here is my dumb post in yospos about this

but to paraphrase, i have 3 branches of a web project that are wildly different. my client has wanted to hold back tonnes and tonnes of work.now they want just a few features pushed to the master/live branch.

i've been doing this pretty well for a while, but this time there's at least 25 commits to cherry-pick and 70 insertions. and so much has changed in the architecture of the app that i'll probably have to go find a dozen more changes that those commits depend on. i'll have to go and carefully choose every insertion and if i get just one thing wrong then the whole thing won't work and i'll have to start over, or do a bunch of hot fixes. it also doesn't help that we have no active users on the site so all the overhead and precaution seems useless and we should really just push all our features live since it's locked behind a beta key system anyway.

my question is, am i a big whiny baby and this is just normal developer job stuff, or is this like impossible?

This is common when there's a big problem in project management. You're not going to be able to unfuck the situation as it currently stands, but you can unfuck it in the future in a few different ways:

1) Keep every individual feature isolated in its own branch until it's ready to be released. Basically, every time you start on a new feature, branch it. When the feature is done, tested, and ready to be released, only then should it be merged back to trunk. Keep in mind that the merges will be nightmarishly painful unless you frequently merge any changes that are happening in your trunk back to your dev branches and resolve conflicts/retest functionality.

2) Branch for each feature, but the second the feature is done and potentially ready for QA/release, merge it to trunk. Keep features isolated behind feature flags (in a config file, database, whatever) so that you can toggle the feature on and off as necessary. When the feature is on in production and everything is fine and you know you'll never want to toggle it off again, remove the feature toggle in code and clean it up so your code doesn't turn into a rat's nest of feature toggle checks over time.

This can lead to improved overall application health because you're constantly testing the codebase as a whole, instead of hoping that when you merge features X, Y, and Z into trunk, they actually don't break each other. A feature that you finish today and then sit on for 6 months is a lot more likely to be horribly broken or difficult to merge.

#2 is the more "continuous delivery"-y way of doing things, although it takes a high level of discipline and a lot of automation to pull it off in the real world.

New Yorp New Yorp fucked around with this message at 19:33 on May 24, 2015

PleasureKevin
Jan 2, 2011


thanks. this is actually what i was doing at first. but being the only developer, i found making and merging all the branches too much wasted overhead. each feature is of course in it's own commit (or sometimes a commit plus another commit to fix something later). is doing that and using git cherry-pick any different from merging branches?

i've always tried to do what you're saying otherwise, pressured my client to push features out as soon as possible, but they won't, for whatever reason.

but anyway, my main question isn't really answered. is it possible to do what my client wants? as in merge some features that are 100 commits ahead of master? should i push back more on this or just bite the bullet?

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





PleasureKevin posted:

thanks. this is actually what i was doing at first. but being the only developer, i found making and merging all the branches too much wasted overhead. each feature is of course in it's own commit (or sometimes a commit plus another commit to fix something later). is doing that and using git cherry-pick any different from merging branches?

i've always tried to do what you're saying otherwise, pressured my client to push features out as soon as possible, but they won't, for whatever reason.

but anyway, my main question isn't really answered. is it possible to do what my client wants? as in merge some features that are 100 commits ahead of master? should i push back more on this or just bite the bullet?

merge everything then use feature flags to turn off the parts your client doesn't want live yet

PleasureKevin
Jan 2, 2011

the talent deficit posted:

merge everything then use feature flags to turn off the parts your client doesn't want live yet

thanks, did not know what those were until now. so then obviously they aren't in my app currently. i'll look into building those in from now on.

however, still wondering about my original question.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

PleasureKevin posted:

however, still wondering about my original question.

Your original question was answered: What you're encountering is common in badly run projects, it's a surmountable problem, but given your current state you're stuck just doing a lot of lovely merges.

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





PleasureKevin posted:

thanks, did not know what those were until now. so then obviously they aren't in my app currently. i'll look into building those in from now on.

however, still wondering about my original question.

this was my answer to your original question. presumably your branch applies relatively cleanly to the current production branch? merge the whole thing then go in and selectively turn off the parts your client doesn't want in yet. obviously if your new features replace parts of the app the client wants to keep live for now you'll have to figure out how to resurrect those parts but the rest of the features your client doesn't want you should be able to turn off fairly easily. you'll have to add a bunch of conditionals all over the place but it's probably easier and safer than trying to selectively extract a subset of features from a large number of commits

Space Whale
Nov 6, 2014
Current job has me doing TFS. Git spoiled me.

Push something, poo poo breaks. Whatever, I say, roll it back! Still broken. Surely it was broken before, and I just rolled back to another broken state?

If this happens, how do I undo the merges but not my changes so I can shelf my work and fix the build?

edit: apparently the tfs server is dying!

Can you use the TFS project tracking and metric stuff and use the git integration with VS, or do you have to stick to tfs for source control when using the work item tracking thing? I'm so done with TFS.

Space Whale fucked around with this message at 15:30 on May 26, 2015

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Space Whale posted:

Current job has me doing TFS. Git spoiled me.

Push something, poo poo breaks. Whatever, I say, roll it back! Still broken. Surely it was broken before, and I just rolled back to another broken state?

If this happens, how do I undo the merges but not my changes so I can shelf my work and fix the build?

edit: apparently the tfs server is dying!

Can you use the TFS project tracking and metric stuff and use the git integration with VS, or do you have to stick to tfs for source control when using the work item tracking thing? I'm so done with TFS.

You can make a team project that uses Git for scm and use all the normal work tracking and build stuff seamlessly. Build 2015 will let you build from external Git as well.

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

Space Whale posted:

Current job has me doing TFS. Git spoiled me.

Push something, poo poo breaks. Whatever, I say, roll it back! Still broken. Surely it was broken before, and I just rolled back to another broken state?

If this happens, how do I undo the merges but not my changes so I can shelf my work and fix the build?

edit: apparently the tfs server is dying!

Can you use the TFS project tracking and metric stuff and use the git integration with VS, or do you have to stick to tfs for source control when using the work item tracking thing? I'm so done with TFS.

I use Git-Tfs bridge to give me a local git repo that I can push into our TFSVC. Beats having to use shelvesets and other stuff to swap between work.

Space Whale
Nov 6, 2014

Ithaqua posted:

You can make a team project that uses Git for scm and use all the normal work tracking and build stuff seamlessly. Build 2015 will let you build from external Git as well.

I'm pushing hard for this right now, especially after we had to end up rebooting TFS itself and having a several hour hellmerge death march over this. Thanks!

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
What is the proper/normal method of adding a new branch to a git repository controlled by gerrit? Some of us wanted to work on a topic branch together, and did not even necessarily care for code review until our work has settled.

Edit: It looks like we have some internal shenanigans for doing this, but I still wonder how grown-ups do this in case we're doing goofy stuff like usual.

Rocko Bonaparte fucked around with this message at 21:58 on Jun 5, 2015

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

I should avoid committing my compiled .css, right? That seems to be the common wisdom. However, that leaves me confused as to how to actually deploy my CSS then. I'm using Beanstalk for Git deployment, which makes things very automated. If I keep my css out of my repo, will I need to manually transfer the .css files every time I deploy? Seems to defeat the purpose of Beanstalk's automation. Is there a better solution?

ExcessBLarg!
Sep 1, 2001

caiman posted:

I should avoid committing my compiled .css, right? That seems to be the common wisdom.
The problem with committing compiled (or other auto-generated) stuff is that every time you make a change to the source, you'll have to (or should) commit the recompiled version too. That's not so bad itself (if you're consistent about it), but if you're working with multiple people on the project you'll inevitably have merge conflicts on the compiled code that you'll have to deal with and it ends up getting messy.

caiman posted:

However, that leaves me confused as to how to actually deploy my CSS then.
Maintain a development branch that's separate from deployment. For example, develop on "develop" and deploy from "master". Don't commit any compiled code to the develop branch, but do commit it to master. So, your procedure every time you deploy would be: commit outstanding changes to develop, checkout master, merge develop, run the compiler, add and commit the new compiled code, then push to your deploy remote.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

That's about what I've been suspecting I should do. But the part that I can't quite get my head around is this:

ExcessBLarg! posted:

...checkout master, merge develop, run the compiler, add and commit the new compiled code...

When I merge develop (in which .css files are included in .gitignore) into master (.css files NOT included in .gitignore), won't master's version of .gitignore get changed to look like develop's (with .css being ignored)?

ExcessBLarg!
Sep 1, 2001

caiman posted:

When I merge develop (in which .css files are included in .gitignore) into master (.css files NOT included in .gitignore), won't master's version of .gitignore get changed to look like develop's (with .css being ignored)?
Depending on how the branches were originally created it may do this, or you might get a merge conflict on .gitignore.

So, assuming that .gitignore is already correct on the two branches (master has no .css files listed, develop does), then what you want to do the first time you merge is to run:
code:
git merge --no-commit develop
git checkout --ours .gitignore
git add .gitignore
git commit
which will record that you want to keep master's version of .gitignore. Subsequent merges from develop will leave .gitignore alone, unless you've made changes to .gitignore in develop. If you do add more .css files to develop's .gitignore, then use "git merge --no-commit" again (although you'll probably get a merge conflict anyways), giving an opportunity to remove any .css files before committing again.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Perfect! Thanks.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Another git merge related question. I was hoping someone could explain why merging one branch into another essentially adds TWO commits into the current branch - the merge commit, as well as a copy of the latest commit of the branch being merged. I know there's a completely reasonable explanation, I just can't seem to find one. Is this just a part of the "recursive" strategy?

ExcessBLarg!
Sep 1, 2001
It's not just two commits. When you merge branches, you're adding all commits from the other branch, since the last common ancestor of the two branches, into the revision history. The purpose of the merge commit itself is to "glue" the two histories together by specifying two parent commits and encoding the resolved state of merge conflicts.

Git is a bit misleading because "git log" shows a linear history by default, but it's actually a graph structure which you can see with "git log --graph". For the default (linear) presentation, "git log" orders commits on all merged branches by their commit time. So if you make one commit on a branch and immediately merge that branch, then yes, you'll see two commits at the top of the revision history.

ToxicFrog
Apr 26, 2008


caiman posted:

Another git merge related question. I was hoping someone could explain why merging one branch into another essentially adds TWO commits into the current branch - the merge commit, as well as a copy of the latest commit of the branch being merged. I know there's a completely reasonable explanation, I just can't seem to find one. Is this just a part of the "recursive" strategy?

It's not a copy. The merge commit has two parent commits, one from the branch being merged into and one from the branch being merged from; the same commit is thus referenced from both branches. It doesn't copy-paste changes from one branch to the other a la 'svn merge' (there's a separate command for that, cherry-pick), but actually ties together the two lines of history.

Fire up 'gitk --all' (or 'git log --oneline --graph --decorate --all' for a terminal version) and you can see this pretty clearly.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Thanks guys, that's the reasonable explanation I was looking for.

Regarding the output of 'git log --graph --decorate --all', is there a good resource that might help me learn to decipher what I'm seeing? It's very pretty, but I can' t make heads or tails out of it.

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

caiman posted:

Thanks guys, that's the reasonable explanation I was looking for.

Regarding the output of 'git log --graph --decorate --all', is there a good resource that might help me learn to decipher what I'm seeing? It's very pretty, but I can' t make heads or tails out of it.

The far left line is the branch you are on, all of the forking "branches" are just that: branches (demarcated by merge commits). The reason you can have multiple lines is multiple branches created at different points off the base tree. Oh, and each * is an actual commit, the dashed lines are just visual so you can follow.

ToxicFrog
Apr 26, 2008


caiman posted:

Thanks guys, that's the reasonable explanation I was looking for.

Regarding the output of 'git log --graph --decorate --all', is there a good resource that might help me learn to decipher what I'm seeing? It's very pretty, but I can' t make heads or tails out of it.

What Necrotic said; in addition, if you use the gitk command instead, you can then click on individual commits and it'll show you more information about them, which can be handy for exploring.

wwb
Aug 17, 2004

caiman posted:

If I keep my css out of my repo, will I need to manually transfer the .css files every time I deploy? Seems to defeat the purpose of Beanstalk's automation. Is there a better solution?

The best way is to get grunt out on the server then have a "build production" config that compiles stuff for production. Compiled artifacts never hit any repo.

o.m. 94
Nov 23, 2009

caiman posted:

Thanks guys, that's the reasonable explanation I was looking for.

Regarding the output of 'git log --graph --decorate --all', is there a good resource that might help me learn to decipher what I'm seeing? It's very pretty, but I can' t make heads or tails out of it.

http://think-like-a-git.net/

Instant enlightment. Then create an alias for this: git log --decorate --oneline --color --all --graph

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

o.m. 94 posted:

http://think-like-a-git.net/

Instant enlightment. Then create an alias for this: git log --decorate --oneline --color --all --graph

Good read, thanks.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I had an interview earlier today at a place that uses https://sourcegear.com/vault/ It's a small team but they write software that basically runs factories and I was momentarily taken aback when the dev I talked to described it as "a better version of VSS" because that's such a low bar to clear that it doesn't seem worth mentioning. I mean, he could have just said "it's like VSS but it works" and I'd be less worried but, yeah, I'm a little worried. Should I be more than a little worried?

wwb
Aug 17, 2004

I had some run ins with it back in the day -- it is definitely archaic but the description of "vss that works" is pretty accurate and it is certainly better than nothing and was a valid technical decision at the time most likely. That said, I'd be a bit worried why they haven't re-visited the decision, it is a red flag there is lots of other archaic poo poo there. Like VB6 or something.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



They did mention that they're currently on a push to clear out archaic poo poo from their production environment, but their ethos struck me a very pragmatic so, if Vault works, I'm guessing they'll just want to keep using it.

Hmm

comedyblissoption
Mar 15, 2006

Ask about their other processes and technologies and see if you want to work in an environment that might've been apropos 10 or 20 years ago.

Hughlander
May 11, 2005

comedyblissoption posted:

Ask about their other processes and technologies and see if you want to work in an environment that might've been apropos 10 or 20 years ago.

If they're doing embedded work for factory equipment I don't think they're webscale

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I did ask all my normal interview questions and that was the only red-flaggy thing that came up. They switched to it from VSS years ago and just don't care to change it because I guess it works for them. If you guys told me that it was basically ClearCase but for MS shops I'd be actually worried but it sounds like it's not a total horror, so I'm still hoping for an offer.

space kobold
Oct 3, 2009


I can't decide if I should use master as a stable/release branch with a long running develop branch running in parallel, or use master as the development branch with a long running stable branch running in parallel.

Only actual difference I suppose is whether you want a development or stable branch to be your "default".

edit: using git.

space kobold fucked around with this message at 17:26 on Jun 16, 2015

MrPablo
Mar 21, 2003

space kobold posted:

I can't decide if I should use master as a stable/release branch with a long running develop branch running in parallel, or use master as the development branch with a long running stable branch running in parallel.

Only actual difference I suppose is whether you want a development or stable branch to be your "default".

edit: using git.

A lot of folks seem to blindly advocate the latter (master as release, development on separate branch), but I think the answer varies depending on the purpose of the repository.

Who are the primary users of the repository?

If the primary users are developers, then it makes sense to do development on the master branch, and maintain a separate stable branch. If the primary users are end users, then it might be more appropriate to develop on a separate branch and push stable changes to master.

Our repositories (which are used primarily by developers) are set up as follows:

  • master: Development.
  • test: Testing. Pushing to this branch invokes a hook which updates our test environments.
  • demo: Changes queued for the next release. After QA signs off on changes in the test branch (using the test environments mentioned above), they go here. Pushing to this branch automatically updates our demo environments.

Once changes in demo have been approved by management, we create a release tag (in the form r20150615), and they are applied to staging and production.

edit: khant tipe or spel.
edit 2: brevity

MrPablo fucked around with this message at 18:49 on Jun 16, 2015

B-Nasty
May 25, 2005

We use master as our "deployed on production" branch, but as you mentioned, it doesn't really matter. The branch names are just for humans; Git don't care. It always seemed to make more sense to me to have feature branches spawning off development than master.

As a follow-up question for others: This setup basically means we are deploying off of development, since we only do the development->master merge once the code is in prod and the CI server has already built the release version from dev. Anything obvious I'm missing here that would make this better?

aerique
Jul 16, 2008
We use git-flow at work and I like it:

Kobayashi
Aug 13, 2004

by Nyc_Tattoo
I'm a Git novice at best. I use SourceTree to get by right now. I have an old wiki with pages that use a proprietary versioning system. I would like to export, version-by-version, to a Git-based repository. It's easy enough to hack something together to get the job done, but I also want to preserve the original timestamps. My question is, how can I "forge" my commit timestamps to match the change history from my old wiki?

I Google'd something similar, but do not understand Git well enough to make sense of the results, particularly the interplay between various timestamps.

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Kobayashi posted:

I'm a Git novice at best. I use SourceTree to get by right now. I have an old wiki with pages that use a proprietary versioning system. I would like to export, version-by-version, to a Git-based repository. It's easy enough to hack something together to get the job done, but I also want to preserve the original timestamps. My question is, how can I "forge" my commit timestamps to match the change history from my old wiki?

Assuming you're running git from a command-line you can pass --date=$timestamp to the git commit command when you commit each revision.

Adbot
ADBOT LOVES YOU

o.m. 94
Nov 23, 2009

Kobayashi posted:

I Google'd something similar, but do not understand Git well enough to make sense of the results, particularly the interplay between various timestamps.

This is where my knowledge gets fluffy, but basically the timestamp of the commit doesn't have any bearing on things from a file perspective. If you had

A <- B <- C

And commits B and C had much earlier timestamps (if that's possible) then it would be no different than if those commits had "logical" timestamps one after the other (A earliest, C most recent). The parent <- child relationship of the commits is what's important here in terms of sequential ordering, not the timestamp.

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