News for hackers. Stuff that matters.
Re: by alwillis on Tuesday November 15, 2022 @05:22PM (#33615940)
I certainly recognized several Mercurial features and concepts in Sapling.

For example, I use Mercurial’s absorb command [1] and was pleased to see it in Sapling.

Overall this looks promising.

[1]: https://gregoryszorc.com/blog/2018/11/05/absorbing-commit-ch...

Re: by jordigh on Tuesday November 15, 2022 @05:28PM (#33616011)
Absorb is fantastic and one of Jun Wu's (seen in this thread as quark12) best contributions to Mercurial. I want everyone to know about this tool, it's amazing. I had fun trying to come up with a name for the feature:

https://lobste.rs/s/nws1uj/help_us_name_new_mercurial_featur...

Re: by sweettea on Tuesday November 15, 2022 @09:42PM (#33618172)
Absorb is amazing! Even if you don't take up Sapling, there's a 'git absorb' plugin which I have found absolutely invaluable: https://github.com/tummychow/git-absorb
Re: by boredtofears on Wednesday November 16, 2022 @02:39AM (#33620109)
Holy crap that looks incredible. I can't wait to try this.
Re: by madsohm on Wednesday November 16, 2022 @02:40AM (#33620112)
Just learned about 'git absorb' couple of weeks ago and have used it every day since. Amazing tool.
Re: by hakre on Wednesday November 16, 2022 @11:17AM (#33625597)
thanks for the reference, using `git-fixup` myself since years: https://github.com/keis/git-fixup

Will try `git-absorb`.

Re: by Too on Wednesday November 16, 2022 @12:47AM (#33619375)
In git you do this like git commit --fixup hashtofix && git rebase -i --autosquash hashtofix^

Hard to discover and remember but once you do it usually works smoothly.

Re: by jordigh on Wednesday November 16, 2022 @01:33AM (#33619651)
No, the point is that you don't have to mention the hash at all, it's automatically deduced by diff context.
Re: by raimue on Wednesday November 16, 2022 @06:05AM (#33621333)
There is git-fixup, which provides the 'git fixup' command that makes suggestions to which commit the currently staged changes should be added.

https://github.com/keis/git-fixup

git-fixup will add fixup! commits, so it still needs the mentioned 'git rebase -i --autosquash' afterwards. Usually you do not even need to give it a specific commit if your branch is set to track an upstream branch.

Re: by jordigh on Wednesday November 16, 2022 @08:09AM (#33622353)
Still not quite the same, because absorb splits up your working directory changes into all relevant commits, as deduced by diff context.
Re: by hakre on Wednesday November 16, 2022 @11:20AM (#33625643)
Staged or unstaged? Sounds interesting, will give it a try. Thanks for the details.
Re: by hakre on Wednesday November 16, 2022 @11:54PM (#33635131)
Dipped into it.

Staged changes, excluding renames.

So git-fixup and git-absorb will now happily live together for the moment on my box.

Made a good first impression, thanks again for the reference.

Re: by mhw on Wednesday November 16, 2022 @08:47AM (#33622789)
Or git commit --fixup=:/<pattern> to find the most recent commit with pattern in the message. Still going to give git-absorb a try though.
Re: by fulafel on Wednesday November 16, 2022 @02:38AM (#33620092)
It seems this is still based on changing history - Does hg have something to address the downsides of rebasing that are present in git? such as chilling effect on cooperation of branches (eg you don't dare touch or use remote branches which someone may use rebase on, and destruction of actual history for use in eg reconstructing a timeline of a bug and fix later found to be important).
Re: by FerociousTimes on Wednesday November 16, 2022 @05:51AM (#33621214)
For the uninitiated, hg, in this context, refers to Mercurial by the chemical symbol (Hg) for Mercury.
Re: by jordigh on Wednesday November 16, 2022 @08:08AM (#33622341)
Yes, hg has changeset evolution. A meta-history of editing propagates when you push rewritten commits.

https://www.mercurial-scm.org/doc/evolution/