Live data from Hacker News

Git-blame-someone-else – Blame someone else for your bad code

github.com

51–60 of 68 posts

Re: Git-blame-someone-else – Blame someone else for your bad code

#51
post #29

Earlier quoted context omitted.

Best in what sense? Bitbucket does everything Github does, plus gives free private repos. GitHub is just more widely used.

Bitbucket crashes minimal browsers like Surf and github doesn't. So, in that regard, Github is better.

Interesting, didn't know that. But it seems easily fixable for BB and probably doesn't drive much of the difference in popularity.

Re: Git-blame-someone-else – Blame someone else for your bad code

#52

(When I saw the title, I was wondering if this does something beyond the basic rebase, like trying to brute force a commit such that all following commits are preserved (hash doesn't change), but that's essentially impossible.) I'm tempted to make the observation that there's nothing here you can't already do with a git rebase -i and: GIT_COMMITTER_NAME=a GIT_COMMITTER_EMAIL=a@a.com GIT_COMMITTER_DATE=2006-01-02T15:0…

> all following commits are preserved (hash doesn't change), but that's essentially impossible. Actually, you only need one brute-force (of the commit that you're changing); subsequent commits only refer to the parent hash, and here we're not changing the commit trees either. SHA1 is already considered broken, so git really should switch to SHA256 soon. This whole "sha1 commit hashes are not for security" argument is…

[deleted]

Re: Git-blame-someone-else – Blame someone else for your bad code

#53
post #29
post #14

Earlier quoted context omitted.

You mean besides developing and operating one of the best services on the web?

Best in what sense? Bitbucket does everything Github does, plus gives free private repos. GitHub is just more widely used.

But Bitbucket is fricken awful though. I think I have an allergy to everything designed by Atlassian

Re: Git-blame-someone-else – Blame someone else for your bad code

#54

Earlier quoted context omitted.

But isn't it somewhat reasonable that I push someone else's commit? Say I want to rewrite an old commit, and then force push that, then all the commits after the rewritten commit by other people would effectively be pushed by me. Or consider the common case where the public repository on Github is just a mirror of an official repository somewhere else -- then commits from a bunch of people would all be pushed by whoe…

They do have a "committed by" feature that appears when you cherry-pick someone else's commit to a branch. It shows up as "Bob committed with Alice". I've only noticed it showing up for cherry-picks, I'm unsure if that's the only place it's used.

They show that if the git commit has differing author and committed fields (It shows up when I reorder and squash commits on branches before merging).

All one has to do to make it go away is change the committer field on the git, this isn't security added by GitHub.

Re: Git-blame-someone-else – Blame someone else for your bad code

#55

It's been my experience, especially in the startup scene where business requirements change often, that `git blame` rarely shows you what you want. Files get renamed, moved, re-indented, etc, frequently. I wrote a tutorial on a more effective (at least for me) solution to find the true author of a change: http://blog.andrewray.me/a-better-git-blame/

Nice tutorial, but aren't you aware that "git blame -w" ignores whitespace changes? git blame also always follows renames. git's rename detection isn't foolproof (if I edit and rename A.cpp to A-star.cpp at the same time as adding a new A.cpp file it won't detect it), however there are two more blame options for that: -C to follow lines copied between files, and -M to follow lines moved within a file.

Unfortunately, adding -M and -C will quite badly increases the time to compute the blame. Both take an adjustable parameter (min number of characters to match), but I found I actually had to reduce it to catch all the lines in an example of the A.cpp -> A-star.cpp move I did yesterday.

Re: Git-blame-someone-else – Blame someone else for your bad code

#56
post #14
post #12

Earlier quoted context omitted.

There are so many things that GitHub could easily do, but don't... Makes me wonder what they actually do.

You mean besides developing and operating one of the best services on the web?

Well, yeah. It is a good service. They've contributed good stuff to Git core, too.

I really wonder what they do. I have some complicated feelings about them, also, that has to do with them becoming the central hub for open source.

Like, if the product itself were open source, it might be more obvious what they are working on. But I can't demand that kind of transparency... It would just be interesting to know.

With almost 500 employees, what happens? I've never even worked at such a large company myself.

Should GitHub users have some say in what the company builds? I mean, we're promoting them like hell, and the social network is a huge part of their value.

I often wonder what well-funded large product companies do with all their manpower. Feature development doesn't seem to scale. Nor innovative design. GitHub's mobile layout is pretty crippled. I dunno. Just curious.

Re: Git-blame-someone-else – Blame someone else for your bad code

#57
post #32
post #9

Earlier quoted context omitted.

It's a bit worrying that GitHub will happily associate someone's face on a commit that they didn't write: https://github.com/jayphelps/git-blame-someone-else/commit/e... Perhaps GitHub should only do this for signed commits or commits to the author's own repository or something. GitHub also allows you to add anyone to a project without their consent (or has this changed?). This reminds me of the Facebook prank where…

Back when I was first learning to use git, I accidentally pushed a commit to my repo as the author of a set of dotfiles I'd cloned. It was a bit mortifying.

One of my coworkers did the same thing years ago, and he still takes flak for it.

Re: Git-blame-someone-else – Blame someone else for your bad code

#58

It's been my experience, especially in the startup scene where business requirements change often, that `git blame` rarely shows you what you want. Files get renamed, moved, re-indented, etc, frequently. I wrote a tutorial on a more effective (at least for me) solution to find the true author of a change: http://blog.andrewray.me/a-better-git-blame/

Nice tutorial, but aren't you aware that "git blame -w" ignores whitespace changes? git blame also always follows renames. git's rename detection isn't foolproof (if I edit and rename A.cpp to A-star.cpp at the same time as adding a new A.cpp file it won't detect it), however there are two more blame options for that: -C to follow lines copied between files, and -M to follow lines moved within a file. Unfortunately,…

I would love to be able to use left and right to skip quickly through revisions when viewing a blame, do you know anything for that?

Re: Git-blame-someone-else – Blame someone else for your bad code

#59
post #38

And this is why I pgp sign all my commits. :-P

I'm actually surprised that git doesn't sign commits by default. (i.e. I had assumed that it did.) It already has the keys set up and such.

No it doesn't. Git works independently of SSH.

Re: Git-blame-someone-else – Blame someone else for your bad code

#60

Earlier quoted context omitted.

Um, mostly no. This can be trivially detected only when you are changing things already pushed. Being a dvcs, you create atleast one commit on your local repo before pushing to a remote. That one (or more) commit can be changed to point at anyone and pushed.

Mostly yes. You rewrite the whole history from the commit you changed authors on and onwards so git will let you know that you have two conflicting histories that needs to be merged. This is why the author needs to force push to master. The only exception to this is if someone else has not pulled into their private repo any changes at or before the commit you changed.

What I am saying is that this tool can be used exclusively while creating commits. Not for retroactive changes.
Post reply on HN