git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Devin Rhode <devinrhode2@gmail.com>
To: git@vger.kernel.org
Subject: Planting new `update-ref refs/heads/new-branch` lines in git-rebase-todo adds semi to end of branch names
Date: Fri, 11 Nov 2022 11:09:33 -0500	[thread overview]
Message-ID: <CAG8sxgmHg0CmD9T01NYUmOC7k7fPSwHjwD7rKXOgyBnVQw6v7Q@mail.gmail.com> (raw)

What did you do before the bug happened? (Steps to reproduce your issue)

1. Run `git rebase -i next` with `--update-refs` or the git config
setting `rebase.updateRefs = true`
2. Given `git-rebase-todo`:
```
pick fjr23j3 foo bar
pick j3j413 bar bar
```

3. Add a new update-ref line like so.
```
pick fjr23j3 foo bar
update-ref refs/heads/devin/foo/bar/bar/bar/branch-new-name;

pick j3j413 bar bar
```
`devin/foo/bar/bar/bar/branch-new-name` branch name does not already exist.
The intention here is to create a new branch name at this point in the
history (to create a stacked PR).

3. Complete rebase, see this output:
```
Successfully rebased and updated
refs/heads/devin/foo-821-analytics-for-checkout.
Updated the following refs with --update-refs:
        refs/heads/devin/edit-step-1-copy  // <-- no semi
        refs/heads/devin/edit-step-2-copy  // <-- no semi
        refs/heads/devin/refactor-foolytics;    // <-- Trailing semi
        refs/heads/devin/foo-821-analytics-for-checkout;  // <-- Trailing semi
```
4.
$ git branch
  devin/edit-step-1-copy
  devin/edit-step-2-copy
  devin/refactor-foolytics;
  devin/rename-logAnalyticsEvents;
  devin/foo-731-add-segment-tracking-to-tutorialfoocom
  devin/foo-736-lock-checkout-behind-a-query-param
  devin/foo-779-add-segment-events-for-all-clicksuser
  devin/foo-779-add-segment-events-for-all-clicksuser;
  devin/foo-808-button-to-re-try-failed-checkout
  devin/foo-808-button-to-re-try-failed-checkout;
* devin/foo-821-analytics-for-checkout
  devin/foo-821-analytics-for-checkout;
+ devin/foo-828-add-sentry-to-tutorialfoocom
  devin/sort-tailwind-classes
  fix/crashing-on-falsy-amazonProductID
  main
  refactor-foolytics

5. After rebasing, paste a series of git push commands into vscode's
integrated terminal:
```
git push origin --force-with-lease
devin/edit-step-1-copy:refs/heads/devin/edit-step-1-copy;
git push origin --force-with-lease
devin/edit-step-2-copy:refs/heads/devin/edit-step-2-copy;
```
I wasn't paying perfect attention to the semicolon at the end of these
git push lines.
Some may have included a semi, some not.

I think at some point, I converted a series of `git push` commands
BACK into `update-ref` commands, because I did a weird rebase thing
and the `update-ref` lines didn't appear on the next rebase.

This is probably an error on my part, but `update-ref` lines added to
`git-rebase-todo` should fail if they end with a semicolon, and the
user should be forced to remove them.

[System Info]
git version:
git version 2.38.1
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 21.6.0 Darwin Kernel Version 21.6.0: Thu Sep 29 20:13:46
PDT 2022; root:xnu-8020.240.7~1/RELEASE_ARM64_T8101 arm64
compiler info: clang: 14.0.0 (clang-1400.0.29.102)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh

[Environment]
Using arm-native macOS terminal
zsh --version:
zsh 5.8.1 (x86_64-apple-darwin21.0)

[Enabled Hooks]
(none)

                 reply	other threads:[~2022-11-11 16:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG8sxgmHg0CmD9T01NYUmOC7k7fPSwHjwD7rKXOgyBnVQw6v7Q@mail.gmail.com \
    --to=devinrhode2@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).