Live data from Hacker News

Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

gitlet.maryrosecook.com

11–20 of 78 posts

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#11

In the 'real' Git, one of the functions I use frequently is `git checkout -- .`, which discards any unstaged changes. Looking at Gitlet's implementation, it wouldn't handle that well as `checkout` can only take a ref. So I guess I'm wondering what the real `git checkout -- .` actually does behind the scenes?

FWIW, since Git 2.23 I prefer using "git switch" and "git restore" instead of "git checkout".

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#12

this is cool! but I'm curious to see a git blame implementation.

You mean the most conflict driven and passive aggressive feature in any programming tooling?

Something tells me I wouldn't want to work in whatever team you work with.

git blame is extremely useful for knowing when something was added, and what the context was. It is not about "blaming" people for mistakes.

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#13

this is cool! but I'm curious to see a git blame implementation.

You mean the most conflict driven and passive aggressive feature in any programming tooling?

`blame` is one of Git’s most useful features for me, because if I’m confused about a piece of code I can instantly check to see when that code was added and why. Does it fix a bug; if so what’s the bug tracker ID and how was it resolved? Why did the programmer chose to do things this way instead of some other way that seems more obvious? How did this change fit into the rest of the codebase, and were any other files or functions changed to match?

(Of course, the utility of this depends on how well people write commit messages. There’s nothing more annoying than looking at a blame and seeing “update somefile.java.”)

If your organization is using blame to stir up conflict and point fingers, that sounds like a human problem rather than a technical problem, and a problem that you would still have even if `git blame` never existed.

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#14

this is cool! but I'm curious to see a git blame implementation.

You mean the most conflict driven and passive aggressive feature in any programming tooling?

My tool is designed to obtain insights from Git history and I've never understood how people can take such offense to git blame. I do agree calling it "blame" was probably not the best thing to do, but the fact is, it serves a purpose, which is, it's designed to help you understand how a piece of code came about.

For you to call this feature "passive aggressive" must have been borne out of some traumatizing experience and for that, you have my sympathy.

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#15

this is cool! but I'm curious to see a git blame implementation.

You mean the most conflict driven and passive aggressive feature in any programming tooling?

That's Linus for you, I guess?

I dunno, I always found `git blame` really funny yet at the same time, I empathize with those who are a little taken aback by it (including... what's the company's name who makes IDEs who calls it "annotate"... ?).

I largely love it because most of the time when I `blame`, that's exactly what I want to do. I don't need software to give me a nicer verb so I can pretend that's not what I'm actually doing.

And most of the time, the author is exactly who I thought it was going to be (which can result in jovial convos) or, more commonly, ITS ME! Oh, the humility. I guess I can see it being a problem if you work on a toxic team (shit, sorry) and yes, I do understand desire for a sheen of positivity in the language of the software we use, but pretty much every of the time I go to call `git blame`, I mean `git BLAME`. While it certainly does happen, I rarely find myself thinking, "Who wrote this amazing code!?? I MUST KNOW!!!" and in those circumstances, it actually soothes my ego to "blame" them for it :D

edited for grammar/spelling

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#16

this is cool! but I'm curious to see a git blame implementation.

You mean the most conflict driven and passive aggressive feature in any programming tooling?

git blame is mostly used to answer the question "when did this change and how?"

Being able to answer that question is key for maintainers.

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#17
post #12

Earlier quoted context omitted.

You mean the most conflict driven and passive aggressive feature in any programming tooling?

Something tells me I wouldn't want to work in whatever team you work with. git blame is extremely useful for knowing when something was added, and what the context was. It is not about "blaming" people for mistakes.

Yea, it strikes me as a poor name. Cheeky perhaps. I once had someone take me aside and ask me if it was rude to use "blame" in github to figure out who touched a specific line. They thought the name implied some sort of finger pointing and fault.

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#19
post #5

Earlier quoted context omitted.

I mean, it just tells you the commit that last changed a line...

it's not that simple. git is a snapshot, i.e. it saves an entire file. How to recover changed lines from it efficiently? And How to do it for the entire history? Basically, I want to understand this code https://github.com/git/git/blob/master/blame.c

I'm so confused on what you're saying. Are you saying it _isn't_ what commit last occurred on the given line?

How would you explain this UI? https://github.com/git/git/blame/master/blame.c

Ie, what does blame mean to you?

Re: Gitlet.js – Git implemented in 1k lines of JavaScript (2015)

#20
post #5

Earlier quoted context omitted.

I mean, it just tells you the commit that last changed a line...

it's not that simple. git is a snapshot, i.e. it saves an entire file. How to recover changed lines from it efficiently? And How to do it for the entire history? Basically, I want to understand this code https://github.com/git/git/blob/master/blame.c

I was replying to another comment that has since been deleted. It said something roughly along the lines of git blame being a contentious and passive aggressive command.

I totally agree the technical implementation would be cool to study :)

Post reply on HN