r/programming • • Jun 19 '14

Reinventing GIT interface

http://tonsky.me/blog/reinventing-git-interface/
221 Upvotes

325 comments sorted by

View all comments

44

u/[deleted] Jun 19 '14

I guess I'm alone in finding git not that hard to use. My only issue is git isn't pretty and to that end I have a few scripts to give me prettier logs (like most people have) and prettier branch summaries (my macro displays all branches, their latest commit id and dates).

Beyond that I manipulate my tree with straight up git commands.

Any halfway competent developer should be able to master git in a couple of weeks let alone be able to write their own version of git given a couple of full time weeks to work in.

0

u/[deleted] Jun 19 '14

[deleted]

28

u/moor-GAYZ Jun 19 '14 edited Jun 19 '14

The set of things you can do with a repository is small enough

The set of things I need to do often, sure, is small enough.

But there's quite a long tail of things that I need to do rarely and have to look them up on the internet because they don't logically follow from anything I do day to day.

How do I delete remote commit tag? How do I make a branch tracking if I failed to do that initially? WTF is the difference between "tree-ish" and "commit-ish" and why does git archive use it to decide whether to use local or commit time when checking out?

That's not at all what the OP is concerned about by the way. They talk about reinventing several fundamental concepts of the interface, like embrace the fact that git repository is append-only (until gc runs) and make it truly append only, so that you always have access to the original commits that you rebased. Also automatically make WIP commits of the working copy before any git operations that can affect it -- I would actually go even further and say that these commits should be fully automatic and continuous, basically I want a persistent undo tree which I can tag as I work and then, after I'm done, arrange my changes into changesets that go to the public history.

7

u/[deleted] Jun 19 '14

How do I delete remote commit?

You don't. That was easy :-)

How do I make a branch tracking if I failed to do that initially?

Git literally tells you this:

fatal: The current branch fake has no upstream branch.
To push the current branch and set the remote as upstream, use

     git push --set-upstream origin fake

etc...

11

u/moor-GAYZ Jun 19 '14

How do I delete remote commit?

Oops, I meant remote tag. I even more or less remember it by now, it's something like git push :/refs/tags/<tag>. It doesn't make much sense to me, but whatever.

Git literally tells you this:

... if I try to push. Just making a branch tracking is more involved.

And to answer my third question, apparently a "tree-ish" that's definitely not a "commit-ish" should have the form <commit-ish>:<path>, where path can be empty if you want to get a snapshot of the entire repository. This is folk wisdom propagating through forums and stackoverflow, by the way, at least I've never seen anything like that in the FM.

3

u/[deleted] Jun 19 '14

Oops, I meant remote tag

You shouldn't do that either. If someone had pulled that tag down they won't notice you deleted it. They'll forever have the older copy of the tag. (which I admit is a failing in Git).

2

u/moor-GAYZ Jun 19 '14

I'm doing that to then point the tag at a different commit, so that's OK, I think.

-1

u/[deleted] Jun 19 '14

Nope. People who have pulled the old tag will never pull the new one and they won't even know it's out of sync.

2

u/moor-GAYZ Jun 19 '14

git fetch --tags seems to update the tag when I try it.

-2

u/[deleted] Jun 19 '14

git pull won't do that.

→ More replies (0)