icerpc-csharp icon indicating copy to clipboard operation
icerpc-csharp copied to clipboard

Improve workflow for updating slice subtree

Open pepone opened this issue 2 years ago • 5 comments

          I was just talking with @bernardnormier and @InsertCreativityHere and we were wondering if we could do the following:
  1. If possible update the subtree action to check for a "subtree like commit message" if there are any files changed in slice/ in a commit. A PR can have multiple commits that change other files. Not sure how doable this is.
  2. The new recommendation would be to open a PR with two commits. The first commit for the subtree, then a second commit for the C# changes.
  3. We wouldn't squash merge this, just a regular rebase merge.

Originally posted by @externl in https://github.com/icerpc/icerpc-csharp/issues/3583#issuecomment-1669871951

pepone avatar Aug 08 '23 16:08 pepone

If we want to keep the icerpc-slice history we just need to preserve the merge commit created by git subtree pull.

As long as we preserve the merge commits it should be fine,

Here the workflow action is too restrictive, to avoid accidentally squashing the changes (which is the default for our PRs) and screwing the slice history.

pepone avatar Aug 08 '23 16:08 pepone

@pepone Some of our previous subtree commits have nice commit messages:

commit 4649f34ff16c14fdc05f34692ade4edac69de959
Merge: 311c23542 30382bdb6
Author: Jose <[email protected]>
Date:   Tue May 9 17:41:27 2023 +0200

    Add 'slice/' from commit '30382bdb64962d184be220f89259b23904f443a3'

    git-subtree-dir: slice
    git-subtree-mainline: 311c235426c182fdbd0633f451a79a1b2cc61d80
    git-subtree-split: 30382bdb64962d184be220f89259b23904f443a3

Our later ones seem to just look like regular run-of-the-mill merge commits.

commit 5f34dee316237630ea138b3887b4e6fa6b36d299
Merge: 334042401 a15d2136c
Author: Bernard Normier <[email protected]>
Date:   Tue Aug 8 11:44:36 2023 -0400

    Merge commit 'a15d2136c1696af85a3e46defcbd8099054486c4' into update-status-codes2

Any idea what the difference is here that causes different messages?

The first one is much more informative.

externl avatar Aug 08 '23 19:08 externl

The first one is for git subtree add the others are for git subtree pull, seems git subtree pull doesn't add special metadata

pepone avatar Aug 08 '23 19:08 pepone

Can we use add, seems to have much nicer messages?

externl avatar Aug 08 '23 19:08 externl

Can we use add, seems to have much nicer messages?

No, you use add only to add the initial subtree, and then you just use pull to upgrade it.

pepone avatar Aug 08 '23 19:08 pepone