git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stan Stanislaus <islaus@gmail.com>
To: git@vger.kernel.org
Subject: git-for-windows: Rarely, checking out a branch will fast-forward that branch to the branch that was just switched from
Date: Fri, 26 Jan 2024 14:17:39 -0600	[thread overview]
Message-ID: <CAOa6pvGV6Uu+N8tt73vaWgx7trgppFB6Hb_W-Wo8e39MMbJ6Og@mail.gmail.com> (raw)

- [x] I was not able to find an open or closed issue matching what I'm seeing

Setup

Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

$ git --version --build-options

git version 2.40.0.windows.1
C:\Users\StanStanislaus> git --version --build-options
git version 2.40.0.windows.1
cpu: x86_64
built from commit: 1d90ca2906dd4b7ddaf0669a13c173ec579d794a
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon

Which version of Windows are you running? Vista, 7, 8, 10? Is it
32-bit or 64-bit?
git version 2.40.0.windows.1 Since it's in the Program Files folder
and not the Program Files (x86) folder I'm going to say 64-bit.

$ cmd.exe /c ver

** Microsoft Windows [Version 10.0.22631.2861] **

What options did you set as part of the installation? Or did you choose the
defaults?

# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
 **

Any other interesting things about your environment that might be related
to the issue you're seeing?

** Using poshgit for PS **

Details

Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** PS **

What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.

# m => git stash; git checkout main; git pull
function Invoke-Git-Stash-Pull-Main {
    $ErrorActionPreference = "Stop"
    & git stash
    & git checkout main
    & git pull
    Write-Host Ran $MyInvocation.MyCommand from `$profile
}
New-Alias -Name m -Value Invoke-Git-Stash-Pull-Main

I'm on: git version 2.40.0.windows.1**

What did you expect to occur after running these commands?

** I expected the main branch to be checked out in the same state I left it.**

What actually happened instead?

Very intermittently and not consistently reproducibly, main is checked
out but fast-forwarded to the state of the branch I just left by
checking main out. This issue seems to be the main issue here, too:
mhutchie/vscode-git-graph#284

I also posted this on the github.com/git-for-windows repo:
https://github.com/git-for-windows/git/issues/4778

═══════════════════
  Stan (David) G. Stanislaus
═══════════════════

                 reply	other threads:[~2024-01-26 20:17 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

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

  git send-email \
    --in-reply-to=CAOa6pvGV6Uu+N8tt73vaWgx7trgppFB6Hb_W-Wo8e39MMbJ6Og@mail.gmail.com \
    --to=islaus@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.
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 NNTP newsgroup(s).