Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable detached head dialogs #2460

Closed
m35 opened this issue Sep 21, 2014 · 10 comments
Closed

Option to disable detached head dialogs #2460

m35 opened this issue Sep 21, 2014 · 10 comments
Labels
:neckbeard: status: pull request only Requested changes won't be implemented by the Core team, community PRs are welcome type: feature request
Milestone

Comments

@m35
Copy link
Contributor

m35 commented Sep 21, 2014

Please add an option to disable the dialog asking to checkout/create a branch when in detached head state.

@KindDragon
Copy link
Contributor

You want commit in detached head state?

@m35
Copy link
Contributor Author

m35 commented Sep 23, 2014

Current behavior when committing while not working on a branch:

  • The "Not on a branch" message appears warning that "This commit will be unreferenced when switching to another branch and can be lost."
  • There is no way around this message unless a branch is checked out.

Desired behavior:

  • Add setting to options: "[ ] Don't show warning when committing when not on a branch (i.e. detached head state)" (or maybe "[X] Show warning when committing when not on a branch (i.e. detached head state)")
  • By default, have the setting show the message. Current behavior remains the same.
  • If the setting is toggled, the "Not on a branch" message does not appear. This is similar (if not identical) to the behavior when on a branch.

@vbjay
Copy link
Contributor

vbjay commented Sep 24, 2014

The reason that is done is so that you don't commit and then loose the
commits because nothing is referencing those commits and git cleans up the
dangling commits. This prevents you from having dangling commits and
having to use the reflog later on.

On Tue, Sep 23, 2014 at 1:10 PM, m35 notifications@github.com wrote:

Current behavior when committing while not working on a branch:

  • The "Not on a branch" message appears warning that "This commit will
    be unreferenced when switching to another branch and can be lost."
  • There is no way around this message unless a branch is checked out.

Desired behavior:

  • Add setting to options: "[ ] Don't show warning when committing when
    not on a branch (i.e. detached head state)" (or maybe "[X] Show warning
    when committing when not on a branch (i.e. detached head state)")
  • By default, have the setting show the message. Current behavior
    remains the same.
  • If the setting is toggled, the "Not on a branch" message does not
    appear. This is similar (if not identical) to the behavior when on a branch.


Reply to this email directly or view it on GitHub
#2460 (comment)
.

Jay Asbury
PC Repair and custom programs $30/hr 1hr min
My Biking Blog http://vbjaybiking.blogspot.com

@m35
Copy link
Contributor Author

m35 commented Sep 24, 2014

Indeed, that is the reason for the existing dialog. And the reason to have the option to disable the dialog is because you're not a git novice, thus well aware of the implications of detached head state and don't need the incessant reminder.

@vbjay
Copy link
Contributor

vbjay commented Sep 24, 2014

Even as a git expert, I can see that mistake happening. It is easy to do
with submodules.

On Tue, Sep 23, 2014 at 11:28 PM, m35 notifications@github.com wrote:

Indeed, that is the reason for the existing dialog. And the reason to have
the option to disable the dialog is because you're not a git novice, thus
well aware of the implications of detached head state and don't need the
incessant reminder.


Reply to this email directly or view it on GitHub
#2460 (comment)
.

Jay Asbury
PC Repair and custom programs $30/hr 1hr min
My Biking Blog http://vbjaybiking.blogspot.com

@jbialobr jbialobr added the :neckbeard: status: pull request only Requested changes won't be implemented by the Core team, community PRs are welcome label Sep 24, 2014
@erik-kallen
Copy link

At least, IMO, it should not show the "detached head" warning while in a rebase.

m35 added a commit to m35/gitextensions that referenced this issue Feb 20, 2017
m35 added a commit to m35/gitextensions that referenced this issue Feb 20, 2017
m35 added a commit to m35/gitextensions that referenced this issue Feb 21, 2017
…without a branch

Adds an option to disable the prompt/warning that suggests
checking out or creating a branch before committing when no
branch is currently checked out (headless state).

Implements feature gitextensions#2460.

* Adds news persistent bool key "DontConfirmCommitIfNoBranch"
* Adds new check box on Settings -> Advanced -> Confirmation page

This setting is added below "Amend last commit"
since both those confirmations can happen at the same time.
m35 added a commit to m35/gitextensions that referenced this issue Feb 21, 2017
…without a branch

Adds an option to disable the prompt/warning that suggests
checking out or creating a branch before committing when no
branch is currently checked out (headless state).

Implements feature gitextensions#2460.

* Adds news persistent bool key "DontConfirmCommitIfNoBranch"
* Adds new check box on Settings -> Advanced -> Confirmation page

This setting is added below "Amend last commit"
since both those confirmations can happen at the same time.
m35 added a commit to m35/gitextensions that referenced this issue Feb 22, 2017
…without a branch

Adds an option to disable the prompt/warning that suggests
checking out or creating a branch before committing when no
branch is currently checked out (headless state).

Implements feature gitextensions#2460.

* Adds news persistent bool key "DontConfirmCommitIfNoBranch"
* Adds new check box on Settings -> Advanced -> Confirmation page

This setting is added below "Amend last commit"
since both those confirmations can happen at the same time.
m35 added a commit to m35/gitextensions that referenced this issue Feb 22, 2017
…without a branch

Adds an option to disable the prompt/warning that suggests
checking out or creating a branch before committing when no
branch is currently checked out (headless state).

Implements feature gitextensions#2460.

* Adds news persistent bool key "DontConfirmCommitIfNoBranch"
* Adds new check box on Settings -> Advanced -> Confirmation page

This setting is added below "Amend last commit"
since both those confirmations can happen at the same time.
m35 added a commit to m35/gitextensions that referenced this issue Feb 22, 2017
…without a branch

Adds an option to disable the prompt/warning that suggests
checking out or creating a branch before committing when no
branch is currently checked out (headless state).

Implements feature gitextensions#2460.

* Adds news persistent bool key "DontConfirmCommitIfNoBranch"
* Adds new check box on Settings -> Advanced -> Confirmation page

This setting is added below "Amend last commit"
since both those confirmations can happen at the same time.
m35 added a commit to m35/gitextensions that referenced this issue Feb 28, 2017
…without a branch

Adds an option to disable the prompt/warning that suggests
checking out or creating a branch before committing when no
branch is currently checked out (headless state).

Implements feature gitextensions#2460.

* Adds news persistent bool key "DontConfirmCommitIfNoBranch"
* Adds new check box on Settings -> Advanced -> Confirmation page

This setting is added below "Amend last commit"
since both those confirmations can happen at the same time.
m35 added a commit to m35/gitextensions that referenced this issue Mar 4, 2017
…without a branch

Adds an option to disable the prompt/warning that suggests
checking out or creating a branch before committing when no
branch is currently checked out (headless state).

Implements feature gitextensions#2460.

* Adds news persistent bool key "DontConfirmCommitIfNoBranch"
* Adds new check box on Settings -> Advanced -> Confirmation page

This setting is added below "Amend last commit"
since both those confirmations can happen at the same time.
m35 added a commit to m35/gitextensions that referenced this issue Apr 2, 2017
…without a branch

Adds an option to disable the prompt/warning that suggests
checking out or creating a branch before committing when no
branch is currently checked out (headless state).

Implements feature gitextensions#2460.

* Adds news persistent bool key "DontConfirmCommitIfNoBranch"
* Adds new check box on Settings -> Advanced -> Confirmation page

This setting is added below "Amend last commit"
since both those confirmations can happen at the same time.
@jbialobr jbialobr added this to the 2.50 milestone Apr 6, 2017
@jbialobr jbialobr closed this as completed Apr 6, 2017
@KindDragon
Copy link
Contributor

Indeed, that is the reason for the existing dialog. And the reason to have the option to disable the dialog is because you're not a git novice, thus well aware of the implications of detached head state and don't need the incessant reminder.

But why you want to commit in detached head state?

@vbjay
Copy link
Contributor

vbjay commented Apr 8, 2017 via email

@ghanique
Copy link

ghanique commented Apr 9, 2017 via email

@KindDragon
Copy link
Contributor

I can think of one scenario where you'd be changing the commits during an
interactive rebase... Since that can be tricky I try to avoid it and in the
scenarios where I can't I'm ok with clicking the "yes, I want to commit in
a headless state"-button.

We just need to disable this dialog when repository in interactive rebase state, it's bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:neckbeard: status: pull request only Requested changes won't be implemented by the Core team, community PRs are welcome type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants