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
FlapYoJacks
Feb 12, 2009

MononcQc posted:

before pushing your branch for a review, squash it into reviewable commits that will individually work and can all reasonably be used as a forking or bisecting point

This is my team and we enforce this heavily. It's very good and cool.

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

Sapozhnik posted:

lol good one

i'm sure somebody itt works with people who actually give one tenth of a gently caress about commit hygeine but i sure as hell don't (work with people who give a poo poo i mean, i always keep my commits well organized)

Open source projects where the contributors are unpaid jerks manage to do it fine

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
commit hygiene is for peeps who dont use git bisect

MononcQc
May 29, 2007

it's also nice if you got things like VSCode gitlens that show the last commit's message in the margin of a line, though I figure it might be fun to have a project where all the annotations about the history of a file are like "fixup" "fix for real", "djfnskdf"

Arcsech
Aug 5, 2008
squash prs on merge and keep prs small, that way you have a clean history on your shared branch but can do git commit -m "loving work already" to your hearts content

MononcQc
May 29, 2007

that's what most workplaces I'm at ended up doing, but I liked merge commits to generate easy changelogs from awking over git logs.

Sh code:
$ cat pr2relnotes.sh
#!/usr/bin/env sh

if [ -z $1 ]
then
    echo "usage: $0 <tag> [pull-request-url]"
    exit 0
fi
export url=${2:-"https://github.com/erlang/rebar3/pull/"}

git log --merges --pretty=medium $1..HEAD | \
awk -v url=$url '
    # first line of a merge commit entry
    /^commit / {mode="new"}

    # merge commit default message
    mode=="new" && / +Merge pull request/ {
        page_id=substr($4, 2, length($4)-1);
        mode="started";
        next;
    }

    # line of content including title
    mode=="started" && /    [^ ]+/ {
        print "- [" substr($0, 5) "](" url page_id ")"; mode="done"
    }'
outputs a markdown changelog like

code:
- [PR Title](URL-to-PR)
...
I've got a variation of this done at most workplaces I had that shipped versioned releases of stuff, but these are a bit more rare outside of OSS, client libraries, or IoT/on-prem stuff these days.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


shoeberto posted:

I'm starting to see how Github's ubiquitousness is causing issues like this with younger programmers. I'm currently training a guy who's very sharp, but because Github/Bitbucket/et al hide so much of the detail in VCSes, there are just fundamentals that he doesn't grasp without a good bit of discussion. Like we do per-commit reviews and he was super confused at why it didn't work like a PR. (Not really a criticism of him, he's learning very quickly, considering)


I freely admit that I don't know much about git and rely on an ide, but I know enough about how the commit trees work and what should be happening which is enough to decode the nonsense messages you get and look at it and go "oh ok I see what's happened" or when to not do something

but idk I feel like just googling stuff or sitting and thinking about what might be going is a super power sometimes... Like this sql planner issue the India response was "well, the one thing changed recently was to add this where clause therefore, instead of it being" and Foo.id = (selec t id from bar where name='butts')" we hard coded it to" foo.id=1" and it worked for some reason" I had to explain that all they've done is force a plan recompile and produced a plan optimised for their test case. For the second time.

Edit: looks like awful app sanitised or fails to post sql statements so I had to put a space on "select"

Powerful Two-Hander fucked around with this message at 23:28 on Feb 5, 2021

redleader
Aug 18, 2005

Engage according to operational parameters

xtal posted:

If you only use proprietary poo poo ware that your work provides, then you don't really have tech skills beyond your work's proprietary poo poo ware

thank u, rms

the onion wizard
Apr 14, 2004

when you're squashing commits (in e.g. a feature branch) do you force push at some point? or do you not push that branch to the remote until it's done and squashed?

sincerely
- a terrible programmer

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


just commit every single thought that comes into your head until you have one jira with 45 commits with such enlightening comments as "made the change"

Edit: i mean I am no angel. I hosed up and made two sequential commits of "fixed xyz" then "removed gaping functional gap in xyz" and didn't bother to squash it but holy poo poo that 45 commits on one fairly sinple jira was not a joke.

Powerful Two-Hander fucked around with this message at 00:05 on Feb 6, 2021

xtal
Jan 9, 2011

by Fluffdaddy

the onion wizard posted:

when you're squashing commits (in e.g. a feature branch) do you force push at some point? or do you not push that branch to the remote until it's done and squashed?

sincerely
- a terrible programmer

You can force push to your feature branch as long as you are the owner of it

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
here we do one branch per PR and since there's usually only one person working on a PR at a time (exception being pairing or w/e), force-pushing PR branches happens all the time. smaller PR's are usually one commit, bigger ones can be split into multiple commits if it makes review easier (e.g. conveys intent of each change better to the reviewer, or lets them keep less context in their head at once, or w/e). once a PR is merged though it's merged into the main branch where we never gently caress with the commit history ever.

we don't do long-lived feature branches here, if we're working on a multi-PR feature that needs to be released all at once we hide it behind a feature flag until it's ready. anything merged into the main branch just goes straight to production.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


TheFluff posted:

bigger ones can be split into multiple commits if it makes review easier (e.g. conveys intent of each change better to the reviewer, or lets them keep less context in their head at once, or w/e).

this is what I try and do but I have a terrible tendency to go back and correct typos and add comments or change poo poo just after

also your commits are garbage and should be squashed, my commits tell a valuable story and must be preserved

Powerful Two-Hander fucked around with this message at 00:11 on Feb 6, 2021

the onion wizard
Apr 14, 2004

xtal posted:

You can force push to your feature branch as long as you are the owner of it

I don't think the version of TFS we're using atm has any concept of branch ownership. pretty sure anyone could force push to master if they wanted

TheFluff posted:

force-pushing PR branches happens all the time.

I figured something like that, I've always avoided forcing unless it's to fix a fuckup

FlapYoJacks
Feb 12, 2009
git rebase -i HEAD~# && git commit --amend && git rebase --continue && git push --force

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

Powerful Two-Hander posted:

this is what I try and do but I have a terrible tendency to go back and correct typos and add comments or change poo poo just after

also your commits are garbage and should be squashed, my commits tell a valuable story and must be preserved

i do a bunch of small commits while working and then do a bunch of mucking around with reordering and squashing them with git rebase --interactive before submitting the PR for review. how much effort i put into this varies a lot though, both with the size of the PR and with how much I care about it and how charitable i'm feeling that particular day. we don't actually have anything that enforces that each individual commit should be buildable or w/e so sometimes fewer fucks are given

Doom Mathematic
Sep 2, 2008

TheFluff posted:

string interpolation in perl5 does the same thing as f-strings in python except instead of putting curly braces around the variable name you just reference it with its sigil instead, like $foo.

Best aspect of this is when you put an email address in a string for the first time,

Perl code:
my $email = "example@gmail.com";
print $email;
and Perl goes "hey that's an error there's no variable called '@gmail'", and that's how most people actually discover Perl's variable interpolation behaviour.

Unless you forgot to put use strict; use warnings; at the beginning of the script, in which case it raises no problems at all and just prints "example.com".

redleader
Aug 18, 2005

Engage according to operational parameters

Powerful Two-Hander posted:

loving sql query planner performance problems can eat my asssssss

extremely this. my current fave is sql server's adaptive memory grants, which are just a lovely little gently caress you


Share Bear posted:

print-debugging is fine for most cases

it's all i have for frontend :C

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



whoa nice syntax coloring works in yospos now

Python code:
for thing in things:
  # idk whatever
  hella(thing)
print(f'i guess it works lol')

Bloody
Mar 3, 2013

XML code:
<holy poo poo="piss" />

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



[code=json]
{"lmaofu=@@~"

mystes
May 31, 2006

Kind of hard to read that white text though

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



mystes posted:

Kind of hard to read that white text though

*hiss*

if you dont like the garbage stylesheet, you can use the bullshit stylesheet.

youve made your own bed.

shoeberto
Jun 13, 2020

which way to the MACHINES?
We just commit straight to trunk and svn update on live periodically throughout the day. Nbd.

shoeberto
Jun 13, 2020

which way to the MACHINES?
The only issue we have is that we use our live DB for dev but we just try to be careful. Postgres 8.4 is pretty resilient at least.

Doom Mathematic
Sep 2, 2008

Sagacity posted:

if at any point in time a programmer says something doesn't work "for some reason" then that's a red flag

stuff doesn't break "for some reason". there's an ACTUAL reason. if you can't be bothered to figure out what it is, you suck as a programmer

edit: i had a few colleagues like that at a previous job and it infuriated me. they would never try to fix any bugs, they'd just randomly try workarounds until the problem didn't appear for a while. especially issues around threading or memory leaks. YES TRY RANDOMLY STABBING IN THE DARK, THAT'S THE SCIENTIFIC METHOD

I worked on an application which made requests to a server maintained by another team, and periodically the responses coming back from the server would start omitting their body. 200 OK, just no content. When we told the team about it, they said "Oh yes, that happens sometimes. When it does, email us so that we can reboot the server."

FamDav
Mar 29, 2008

xtal posted:

If you only use proprietary poo poo ware that your work provides, then you don't really have tech skills beyond your work's proprietary poo poo ware

the trick is you resell your entire internal infrastructure and become the #1 cloud provider, op

cool av
Mar 2, 2013

it's so sad that git became the predominant source control tool, we should've waited for a 2nd generation of dvcs tools to come out before settling down.

Nomnom Cookie
Aug 30, 2009



git is the worst vcs, except for all the others that have been tried

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

redleader posted:

it's all i have for frontend :C

what are you running your frontend on?

animist
Aug 28, 2018

Nomnom Cookie posted:

git is the worst vcs, except for all the others that have been tried

it's too bad nobody's ever tried mercurial :/

xtal
Jan 9, 2011

by Fluffdaddy

animist posted:

it's too bad nobody's ever tried mercurial :/

Tried writing it in a fast language?

redleader
Aug 18, 2005

Engage according to operational parameters

Zaxxon posted:

what are you running your frontend on?

for some reason, chrome's debugger just fails horribly as soon as it hits an async call in our old-webpack-frontend-monstrosity. so i usually just chuck some console.logs in

Shakespearean Beef
Jul 12, 2008

Ask me all about how I proudly marched alongside literal NEO-NAZIS to protest against the GOVERNMENT taking away our FREEDOMS because of nothing mote that the common FLU!!! I'm holding aloft the TORCH of FREEDOM!!
use darcs

shoeberto
Jun 13, 2020

which way to the MACHINES?

animist posted:

it's too bad nobody's ever tried mercurial :/

We actually use hg at work and I quite like it. It's got the same design paradigms as git but (imo) more friendly command syntax. Just a shame it never took off.

shoeberto
Jun 13, 2020

which way to the MACHINES?
(We're on the verge of migrating to git because of the lack of widespread hg support...)

xtal
Jan 9, 2011

by Fluffdaddy

Pijul is the new darcs but they keep rewriting it so it will never be ready for use

MrMoo
Sep 14, 2000

redleader posted:

for some reason, chrome's debugger just fails horribly as soon as it hits an async call in our old-webpack-frontend-monstrosity. so i usually just chuck some console.logs in

Flip between :chome: and Firefox, sometimes Mozilla can do something right.

DrPossum
May 15, 2004

i am not a surgeon
ctps:

found a "how many times have I done operation to thing" field in a hand rolled log stored in a db

This is stored as a float, and when they increment it they cast it to an int and then back to a float, and then update the value

At this point you might ask yourself why are you updating a log? It is because that log is also being used as a stateful work queue, dummy

How did I find this out? Because I added some logging to see what the gently caress this thing was doing and I broke it because the work queue-log parser started getting entries it couldn't handle

the floating point counter is not used

Adbot
ADBOT LOVES YOU

DrPossum
May 15, 2004

i am not a surgeon
double post

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