[Bug 2037776] [NEW] Enable advice suggestDetachingHead

Alex Efimov 2037776 at bugs.launchpad.net
Sat Sep 30 05:29:25 UTC 2023


Public bug reported:

I think this is disabled by the package because it is enabled by default
in git. If this is incorrect, please ignore this post.

suggestDetachingHead should be enabled because it only appears when
using the `git-switch` command incorrectly. Specifically, the command
`git checkout [--detach] <commit>` is a valid command while `git switch
--detach <commit>` is not. The latter is likely to only be encountered
when migrating from `checkout` to `switch`. It should never appear
during normal usage. Hence, the advice should be enabled as it does not
interrupt any normal workflow unlike some other `advice.*` options.

1:2.34.1-1ubuntu1.10

What happened:
$ git switch a03acc
fatal: invalid reference: a03acc

Expected:
$ git switch a03acc
fatal: invalid reference: a03acc
If you want to detach HEAD at the commit, try again with the --detach option.

** Affects: git (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to git in Ubuntu.
https://bugs.launchpad.net/bugs/2037776

Title:
  Enable advice suggestDetachingHead

Status in git package in Ubuntu:
  New

Bug description:
  I think this is disabled by the package because it is enabled by
  default in git. If this is incorrect, please ignore this post.

  suggestDetachingHead should be enabled because it only appears when
  using the `git-switch` command incorrectly. Specifically, the command
  `git checkout [--detach] <commit>` is a valid command while `git
  switch --detach <commit>` is not. The latter is likely to only be
  encountered when migrating from `checkout` to `switch`. It should
  never appear during normal usage. Hence, the advice should be enabled
  as it does not interrupt any normal workflow unlike some other
  `advice.*` options.

  1:2.34.1-1ubuntu1.10

  What happened:
  $ git switch a03acc
  fatal: invalid reference: a03acc

  Expected:
  $ git switch a03acc
  fatal: invalid reference: a03acc
  If you want to detach HEAD at the commit, try again with the --detach option.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/git/+bug/2037776/+subscriptions




More information about the foundations-bugs mailing list