Fossil Forum

"git merge-base" equivalent?
Login

"git merge-base" equivalent?

"git merge-base" equivalent?

(1) By Alfred M. Szmidt (ams) on 2022-11-01 16:07:36 [source]

What would the equivalent be in fossil? I've generally avoided merges, and other such things ... but a user of vc-fossil (Emacs VC mode for Fossil) asked for support for it.

https://git-scm.com/docs/git-merge-base

(defun vc-git-mergebase (rev1 &optional rev2)
  (unless rev2 (setq rev2 "HEAD"))
  (let ((base (vc-git--run-command-string nil "merge-base" rev1 rev2)))
    (if base
        (string-trim-right base)
      (error "No common ancestor for merge base"))))

(2) By Daniel Dumitriu (danield) on 2022-11-01 21:58:44 in reply to 1 [link] [source]

Try fossil test-find-pivot <MERGE_SRC> <MERGE_DEST>.

(3) By Alfred M. Szmidt (ams) on 2022-11-02 08:17:59 in reply to 2 [link] [source]

Thank you!

Pitty that it is a test-FOO command (unsupported, might break, ....), any plans on changing that? :-)

(4) By Richard Hipp (drh) on 2022-11-02 11:17:38 in reply to 3 [link] [source]

I would be willing to make this change in the 2.21 release cycle, if you will remind me. But not now, because are currently pencils-down for the 2.20 release.

(5) By Alfred M. Szmidt (ams) on 2022-11-19 09:20:40 in reply to 4 [link] [source]

Ping.

While vc-fossil mode for Emacs will need to check both the old and new version, I think this would be a nice addition still.

(6) By Stephan Beal (stephan) on 2022-11-19 14:03:54 in reply to 5 [link] [source]

Ping.

Done.

(7) By Andy Bradford (andybradford) on 2022-11-19 17:39:33 in reply to 6 [link] [source]

Should this be called something less Gittish and more Fossilish?

Thanks,

Andy

(8) By Stephan Beal (stephan) on 2022-11-19 18:02:38 in reply to 7 [link] [source]

Should this be called something less Gittish and more Fossilish?

i'm ambivalent. That name was suggested by Richard in /chat specifically so that it's gittish.