Slackbot
01/09/2024, 6:16 PMAryaman
01/09/2024, 6:17 PMgt merge is to merge the PRs (same as pressing merge button on UI). gt restack rebases your stack correctly.Ben Jaffe
01/09/2024, 6:19 PMBen Jaffe
01/09/2024, 6:19 PMBen Jaffe
01/09/2024, 6:22 PMAryaman
01/09/2024, 6:24 PMgit merge, so I'll caution for now until someone has a more well thought out answer.Ben Jaffe
01/09/2024, 6:44 PMJacob Gold
01/09/2024, 6:50 PMmerge at all by default, but I would ask what sorts of merges you are curious about. There are probably a lot of cases where it would be fine, as rebase is pretty smart about handling merges, but the rare case where it would break something would likely be quite annoying to deal with...Ben Jaffe
01/09/2024, 6:55 PM`git checkout <branchname>` checkout your branch
`git merge <hash>` pull the branch forward (resolve conflicts if needed)
`yarn ts-node -T ./server/src/scripts/one-offs/prettierTo80CharPrintWidth.ts`
`git commit -am "run prettier script"`
`git merge main` (resolve conflicts if needed)
For users who use Graphite, the steps are:
`gt checkout <branchname>` checkout your branch
`git cherry-pick <hash>` to get the codemod script
`gt squash` (it'll prompt you for a commit name, or you can pass `-m "new commit message goes here"`)
`yarn ts-node -T ./server/src/scripts/one-offs/prettierTo80CharPrintWidth.ts`
`gt modify -a` to add the prettier changes to your
`gt restack` (resolve conflicts if needed)
But I think this won't work for stacks, since it won't know which change was "first" when running the script on each branch and trying to restack.
I'm trying to think of ways to handle this with stacks working too...Ben Jaffe
01/09/2024, 6:57 PMJacob Gold
01/09/2024, 6:57 PMJacob Gold
01/09/2024, 6:57 PMBen Jaffe
01/09/2024, 6:59 PMBen Jaffe
01/09/2024, 7:05 PMif (a === 'original value' && bar) {
change A
if (a === 'new value' && bar && foo && c === anotherValue) {
change B
if (b === someOtherValue && foo && bar) {
change C
if (foo && bar) {
original prettified
if (
a === 'original value' &&
bar
) {
change A prettified
if (
a === 'new value' &&
bar &&
foo &&
c === anotherValue
) {
change B prettified
if (
b === someOtherValue &&
foo &&
bar
) {
change C prettified
if (foo && bar) {
would that restack actually work? I could imagine it not knowing which lines to pick since it's not super clear what happened to each of the changes with the codemodding.Jacob Gold
01/09/2024, 7:08 PMBen Jaffe
01/09/2024, 7:45 PMBen Jaffe
01/09/2024, 7:46 PM<<<<<< ======= >>>>>>>Ben Jaffe
01/09/2024, 7:46 PMJacob Gold
01/09/2024, 7:59 PMBen Jaffe
01/09/2024, 8:01 PMBen Jaffe
01/09/2024, 8:01 PMBen Jaffe
01/09/2024, 8:02 PM