Hacker News new | ask | show | jobs
by rralian 3599 days ago
And we use git-rebase commonly on public commits without concern. Everyone uses git differently.
1 comments

I think this depends on your definition of public? For me public means "in stable branches". I sure hope you aren't rebasing master
That's a weird definition of 'public'; for most folks, I imagine 'public' to mean anything accessible without any authorization.
When people talk about public commits it means commits other people have access too, and more specific, were able to commit on top. Authorization has nothing to do with it. In practice it means anything you have pushed.

An exception can be made for topic branches, especially in a pull-request workflow. These branches could be rebased / amended to update the final result, even after they have been pushed already.

"commits other people have access to"

That's authorization.

You said:

> anything accessible without any authorization.

Even if it does require authorization, it's considered public in regard to this discussion.

It's not public if the public can't read it (requires authorization).

Why is this a conversation?

Yeah maybe public isn't a good term for it, I usually use the term stable. So any pushed commits are indeed public, but they are only stable when they reach a stable branch. This means that if I am working on a branch I may remove, add, amend, reorder commits even after I've pushed them. If you constrain rebasing only to unpushed(not public) commits then you instead end up discouraging pushing code to the remote.