Live data from Hacker News

Git Blame-Someone-Else

github.com

51–60 of 69 posts

Re: Git Blame-Someone-Else

#51
post #48
post #45

Earlier quoted context omitted.

GP isn't saying GitHub should copy the entire repo, only that there should be some indication that the code you're looking at isn't the repo owner's (despite being committed in their name and on a repo they "control"). I don't see what optimization requires that. They already keep track of e.g. me pushing up someone else's commit after a rebase -- it indicates that I pushed but the commit originally came from someone…

> I don't see what optimization requires that. From a single commit ID you cannot tell which repo it came from. A "repo" is just a tree of commits.

Even if you're deduplicating commits / data internally, you can tell that that commit is not present in that repo as it is not an ancestor to any ref in that repository.

(You might argue that determining what refs contain a commit is potentially expensive, perhaps, but GitHub already does this, so I'd argue that it's not that expensive.)

Re: Git Blame-Someone-Else

#52
Obligatory self-promotion of my opposite joke project, git-upstage, which steals credit for someone else's work. (Squashes their branch to a single commit under your name and backdates it five minutes.)

https://github.com/SilasX/git-upstage

(Inspired by the time someone typo'd "unstage" to "upstage" and I guessed what a git-upstage command would be.)

Re: Git Blame-Someone-Else

#53
post #14

This might have a serious use. I have a private repo that I worked on with my daughter. If I open source it, ideally I'd keep the chronological history but scrub her email address out of it. It's OK that all the commit hashes would change. Would I want to adapt this joke tool to that purpose, or is there an exiting tool for rewriting history that way?

GitHub also supports a special @users.noreply.github.com address if you wanted her to retain semi-anonymous authorship as a GitHub user.

Re: Git Blame-Someone-Else

#54
post #48

Earlier quoted context omitted.

> I don't see what optimization requires that. From a single commit ID you cannot tell which repo it came from. A "repo" is just a tree of commits.

Then it should be possible to store the originating repo along with the commit so that commits aren't visible in a given "repo" until they are pushed or pulled into that repo

Storing all commit origins at the scale of github is the expensive part.

Re: Git Blame-Someone-Else

#55
post #47

Earlier quoted context omitted.

Cryptographically signing the commits makes rebasing impossible (or at least more difficult). In some cases the rebase is very clean, and none of the modified files had changed by other commits. I guess in this case, git can have a rule to keep a "link" to the old commit and accept the old signature as a signature of the new commit. In some cases there are trivial changes, like indentation because someone else added…

That's because you are not supposed to rebase other people's code on top of a changed base. That can effectively modify the behaviour of their code change. So it's good that the resulting commit won't be signed anymore. And if you are rebasing your own code, then you can sign it again.

What about cherrypicking bug fixes to old versions?

Re: Git Blame-Someone-Else

#56
post #53
post #14

This might have a serious use. I have a private repo that I worked on with my daughter. If I open source it, ideally I'd keep the chronological history but scrub her email address out of it. It's OK that all the commit hashes would change. Would I want to adapt this joke tool to that purpose, or is there an exiting tool for rewriting history that way?

GitHub also supports a special @users.noreply.github.com address if you wanted her to retain semi-anonymous authorship as a GitHub user.

The repo is on gitlab, but I can always make up a noreply address.

Re: Git Blame-Someone-Else

#57
post #33

I really dislike the term chosen for this feature. “Blame”, assumes the code is broken or written improperly in some way. Most of the time I use it I’m just trying to find out who wrote it so I can find the original commit to understand it in more context. Should have named it “git who”

SVN has the alias "svn praise". I was disappointed that git didn't have it, so I created myself one. I'm glad git has trivial support for aliases.

AFAIK original was "cvs annotate" [1]. Subversion introduced "svn blame" and "svn praise" aliases for "svn annotate" as some kind of joke. It's funny that git only has "git blame".

[1] https://compbio.soe.ucsc.edu/cvsdoc/cvs-manual/cvs_74.html

Re: Git Blame-Someone-Else

#58
post #50
post #48

Earlier quoted context omitted.

> I don't see what optimization requires that. From a single commit ID you cannot tell which repo it came from. A "repo" is just a tree of commits.

Good thing Github is allowed to associate data with a commit ID, like they already do with rebased commits, as noted in the subsequent sentence.

This information is part of the commit created by git and not "associated data" added by GitHub.

Re: Git Blame-Someone-Else

#59
post #22

Earlier quoted context omitted.

> the repo "network" This is actually an optimization done by GitHub. It would take up a lot of space if GitHub copied the entire repo every time someone forked it, so they keep all the commits in the original repo. As a side effect, commits in forks are accessible from the original repo since commits from both repos are stored in the same place.

I'd imagine this is why GitHub disallows private forks?

Yes. If they did this, private commits might even leak into packfiles fetched from GitHub by git.

Re: Git Blame-Someone-Else

#60
post #58
post #50

Earlier quoted context omitted.

Good thing Github is allowed to associate data with a commit ID, like they already do with rebased commits, as noted in the subsequent sentence.

This information is part of the commit created by git and not "associated data" added by GitHub.

Really? Where is git storing it? I don't see any information about my rebases in the message, or who pushed it.
Post reply on HN