Monorepo for Tangled tangled.org

feat: reference pull in merge commit #322

Closed blauhai.at
Closed opened by blauhai.at

I created this commit (click) via a patch (click)

I think that the commit should append a (#23), where the #23 links to the pull.

Example: fix: crash when adding/removing user to/from lists -> fix: crash when adding/removing user to/from lists (#23)

some notes related to this issue:

  • currently, we aren't sharing the counter for issues and PRs. so #NNN won't just work as we can't know if it's referring to an issue or a PR.
  • we are planning to support dedicated prefix for issue ids and PR ids.
  • issue/pull ids are not fully atprotated yet.

Closing this as we now have merge-merge support!

sorry, but I am unsure about what you mean with "merge-merge support", could you explain? thanks

When you click "merge" button on PR page, we actually did rebase before, thus we didn't create a merge commit referencing the PR. All changes are rebased on top of target branch as-is, existing commit messages are kept and extra merge-commit is not created, so you won't get merge commit with message referencing the PR. This is same behavior from GitHub when you select "Rebase and merge" option.

Now, we support actual three-way merge, just like GitHub's "Create a merge commit" option which is their default. Because this option creates a merge commit, it adds new commit that merges source branch into target branch with commit message referencing the PR just like you described.

is there a "squash and merge" option? (I had assumed that this is what tangled already did, my bad)

Not yet, but pretty easy to add. so soon!

As an alternative option to this, would be great to use git trailers instead of modifying the user generated commit for this. Adding (#23) to squash commits is something that GitHub has gotten "wrong" for many years. In the sense that we accept it, but only as the least bad of the options when you want a neat linear history that doesn't fight the tooling all the way.

I still think doing the github style squash is a good thing to have for compatibility with existing systems, but it's worth considering approaches that solve the problem better. A trailer would more naturally be an id that survives moving source control systems as it references the actual system and not just an relative id. Just think about your repos that you're migrating from github to tangled and what #23 means in all your historic commits.

Trailer is good idea! I wonder if there is preceding work about using commit trailer like this.

Just think about your repos that you're migrating from github to tangled and what #23 means in all your historic commits.

Though this won't be much problematic once we have #4769.

Though this won't be much problematic once we have #4769.

Neat.

You'll still have a little problem of conflicting id ranges. Is (#23) in github or this repo? So it's worth storing some metadata on tangle's commit metadat that helps make the source system that a ambiguous reference links to.

Sign up or Sign in to add to the discussion.