pharo-vcs / iceberg

Iceberg is the main toolset for handling VCS in Pharo.
MIT License
134 stars 85 forks source link

Branch master is still taken by default when loading a baseline #1644

Open jordanmontt opened 1 year ago

jordanmontt commented 1 year ago

If you load a baseline like this:

Metacello new
  baseline: 'AllocationProfiler';
  repository: 'github://jordanmontt/object-creation-pharo-experiment';
  load.

You will have an exception saying that brach master does not exist. Which is correct, since some years ago GitHub now uses main as default branch and not master. Iceberg should support both options

guillep commented 1 year ago

Hi @jordanmontt are you sure this is an iceberg issue or a metacello issue?

Iceberg does pretty well at downloading the default branch of a repository when you use its UI.

tesonep commented 1 year ago

This is a problem of Metacello, Metacello is taking the default as master. Changing the metacello-iceberg integration to honor the default branch is a bad option because:

The only solution I see is to make the commitish name (branch, tag or commitID) not optional, as the default. But this will break all compatibility with existing baselines 😭

Do you have any idea?

jordanmontt commented 1 year ago

Thanks Guille and Pablo for your responses,

For the idea of how to do it, I don't know.

Should I leave this issue open?

tinchodias commented 1 year ago

I agree this is responsibility of Metacello.

However I let this information here: At the low-level, I've found a LibGit function to obtain the default branch of a remote. This is a recent PR to add it in our FFI bindings: https://github.com/pharo-vcs/libgit2-pharo-bindings/pull/71