git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning.
Cy Schubert
Cy.Schubert at cschubert.com
Thu Apr 29 20:20:11 UTC 2021
In message <20210429200740.5e8bfe5a at bsd64.grem.de>, Michael Gmelin writes:
>
>
> On Thu, 29 Apr 2021 10:30:24 -0700
> Cy Schubert <Cy.Schubert at cschubert.com> wrote:
>
> > Going back in time through each daily snapshot, my April 26 0230U
> > snapshot first exhibited the problem.
>
> Yes, like I wrote, the problem was introduced in 8ea9013512 (which was
> on April 26th).
>
> If you take your snapshot from - let's say - April 27th, you can also
> easily demonstrate the problem by doing:
>
> cp -a /usr/src /usr/srccopy
> cd /usr/src/srccopy
> git status
No luck with this.
>
> Or by doing:
>
> cd /usr/src
> rm .git/index
> git reset
> git status
No luck with this either:
slippy$ pwd
/x/test/29
slippy$ rm .git/index
slippy$ git reset
Unstaged changes after reset:
M contrib/bc/bc.vcxproj
M contrib/bc/bc.vcxproj.filters
M contrib/bc/bcl.vcxproj
M contrib/bc/bcl.vcxproj.filters
M etc/mtree/BSD.var.dist
M sys/dev/bge/if_bge.c
M sys/dev/bge/if_bgereg.h
M sys/geom/geom.h
M sys/geom/geom_int.h
M sys/geom/geom_kern.c
M sys/geom/geom_subr.c
It took 404.90 seconds to enumerate unstaged changes after reset. You can
use '--quiet' to avoid this. Set the config setting reset.quiet to true
to make this the default.
slippy$ git st
Refresh index: 100% (86556/86556), done.
On branch komquats
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: contrib/bc/bc.vcxproj
modified: contrib/bc/bc.vcxproj.filters
modified: contrib/bc/bcl.vcxproj
modified: contrib/bc/bcl.vcxproj.filters
modified: etc/mtree/BSD.var.dist
modified: sys/dev/bge/if_bge.c
modified: sys/dev/bge/if_bgereg.h
modified: sys/geom/geom.h
modified: sys/geom/geom_int.h
modified: sys/geom/geom_kern.c
modified: sys/geom/geom_subr.c
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
no changes added to commit (use "git add" and/or "git commit -a")
slippy$ git stash push -m foobar
Saved working directory and index state On komquats: foobar
slippy$ git st
On branch komquats
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: contrib/bc/bc.vcxproj
modified: contrib/bc/bc.vcxproj.filters
modified: contrib/bc/bcl.vcxproj
modified: contrib/bc/bcl.vcxproj.filters
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
no changes added to commit (use "git add" and/or "git commit -a")
slippy$
>
> or by doing:
>
> cd /usr/src
> touch contrib/bc/*vcx*
> git status
Same slippy$ touch contrib/bc/*vcx*
You have new mail.
slippy$ git st
On branch komquats
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: contrib/bc/bc.vcxproj
modified: contrib/bc/bc.vcxproj.filters
modified: contrib/bc/bcl.vcxproj
modified: contrib/bc/bcl.vcxproj.filters
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
no changes added to commit (use "git add" and/or "git commit -a")
slippy$
Next I tried committing the following to the branch:
slippy$ git br
* komquats
main
slippy$ git ci contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters
contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters
hint: Waiting for your editor to close the file...
Foobar.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch komquats
# Changes to be committed:
# modified: contrib/bc/bc.vcxproj
# modified: contrib/bc/bc.vcxproj.filters
# modified: contrib/bc/bcl.vcxproj
# modified: contrib/bc/bcl.vcxproj.filters
#
# Untracked files:
# sys/i386/conf/IPFILTER
# usr.sbin/ufdformat/
#
~
~
~
~
~
~
~
~
/x/test/29/.git/COMMIT_EDITMSG: 15 lines, 425 characters
[komquats 1155c1951d3c] Foobar.
4 files changed, 713 insertions(+), 713 deletions(-)
slippy$ git co main
Switched to branch 'main'
Your branch is up to date with 'freebsd/main'.
slippy$ git co komquats
error: Your local changes to the following files would be overwritten by
checkout:
contrib/bc/bc.vcxproj
contrib/bc/bc.vcxproj.filters
contrib/bc/bcl.vcxproj
contrib/bc/bcl.vcxproj.filters
Please commit your changes or stash them before you switch branches.
Aborting
slippy$ git st
On branch main
Your branch is up to date with 'freebsd/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: contrib/bc/bc.vcxproj
modified: contrib/bc/bc.vcxproj.filters
modified: contrib/bc/bcl.vcxproj
modified: contrib/bc/bcl.vcxproj.filters
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
no changes added to commit (use "git add" and/or "git commit -a")
slippy$
The only solution is to rm the files, checkout main, blow away the branch
and recreate it. And that, only before checking out main or main itself
hosed. I already did this, the following this morning. This is more an
academic exercise on my part:
Rollback snapshot.
slippy$ git br
* komquats
main
slippy$ git stash push -m my-work
Saved working directory and index state On komquats: my-work
slippy$ git st
On branch komquats
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
nothing added to commit but untracked files present (use "git add" to track)
slippy$ git co main
Switched to branch 'main'
Your branch is up to date with 'freebsd/main'.
slippy$ git st
On branch main
Your branch is up to date with 'freebsd/main'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
nothing added to commit but untracked files present (use "git add" to track)
slippy$ git pull -r --all
Fetching freebsd
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (35/35), done.
remote: Total 144 (delta 34), reused 34 (delta 34), pack-reused 109
Receiving objects: 100% (144/144), 99.01 KiB | 355.00 KiB/s, done.
Resolving deltas: 100% (86/86), completed with 19 local objects.
>From https://git.freebsd.org/src
a4b5f7ba3e9b..420d30f5bdbf main -> freebsd/main
1a34afa9541e..aa4eb2089751 stable/13 -> freebsd/stable/13
Updating a4b5f7ba3e9b..420d30f5bdbf
Fast-forward
contrib/bc/bc.vcxproj | 554 ++++++++++++++++++++------------------
---
contrib/bc/bc.vcxproj.filters | 362 +++++++++++++--------------
contrib/bc/bcl.vcxproj | 320 ++++++++++++------------
contrib/bc/bcl.vcxproj.filters | 190 +++++++-------
release/arm/armv7.conf | 8 +
share/man/man9/kasan.9 | 22 +-
share/mk/src.libnames.mk | 3 -
sys/amd64/amd64/pmap.c | 2 +-
sys/dev/ipmi/ipmi_isa.c | 4 +
sys/dev/ipmi/ipmi_pci.c | 4 +
sys/dev/ipmi/ipmi_smbios.c | 19 +-
sys/dev/ipmi/ipmi_smbus.c | 4 +
sys/kern/subr_asan.c | 10 +-
sys/netpfil/pf/pf_nv.c | 8 +-
sys/sys/asan.h | 2 +-
15 files changed, 776 insertions(+), 736 deletions(-)
create mode 100644 release/arm/armv7.conf
slippy$ git co komquats
Switched to branch 'komquats'
slippy$ git rebase main
error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.
slippy$ git st
On branch komquats
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: contrib/bc/bc.vcxproj
modified: contrib/bc/bc.vcxproj.filters
modified: contrib/bc/bcl.vcxproj
modified: contrib/bc/bcl.vcxproj.filters
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
no changes added to commit (use "git add" and/or "git commit -a")
slippy$ rm contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters
contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters
slippy$ git co main
Switched to branch 'main'
Your branch is up to date with 'freebsd/main'.
slippy$ git st
On branch main
Your branch is up to date with 'freebsd/main'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
nothing added to commit but untracked files present (use "git add" to track)
slippy$ git br -d komquats
Deleted branch komquats (was 41ce0e34ea42).
slippy$ git co -b komquats
Switched to a new branch 'komquats'
slippy$ git stash pop
On branch komquats
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: etc/mtree/BSD.var.dist
modified: sys/dev/bge/if_bge.c
modified: sys/dev/bge/if_bgereg.h
modified: sys/geom/geom.h
modified: sys/geom/geom_int.h
modified: sys/geom/geom_kern.c
modified: sys/geom/geom_subr.c
Untracked files:
(use "git add <file>..." to include in what will be committed)
sys/i386/conf/IPFILTER
usr.sbin/ufdformat/
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (33071593e430eeaa3782d582534c057c968776f6)
slippy$
I didn't have any committed work in this branch so recreating the branch
from scratch was painless.
>
> >
> > My remediation efforts are below:
> >
> >> ...
> > slippy$
> >
> >
> > There is no way to move forward except to rm (not git rm but UNIX rm)
> > the files. Checkout another branch and blow away the affected branch.
> > With the files physically deleted with rm(1) I could switch branches
> > and blow away the affected branch. Without this extreme I can't even
> > switch branches.
>
> AFAIK there are two options forward:
>
> 1. Simply add the files that are shown as changed on your local branch
> (that's all my commit did, "git commit -a").
> 2. Temporarily do:
> echo "contrib/bc/bc*.vcx* -text" >>.git/info/attributes
Neither of those worked for me. Again this is purely academic now but
looking to understand this should it happen again, with committed work.
>
> >
> > Lucky for me this branch was a placeholder maintaining a record of
> > what was installed on my laptop vs main, so it's easy to blow away
> > and recreate. But for people with committed changes to a branch this
> > would be a huge problem.
>
> The two things above should work.
>
> >
> > My other branches which I rebase much less frequently were unaffected.
> >
> >
>
> AFAIK this only affects branches which happen to contain changes
> since 8ea9013512.
>
> If not, I'm afraid some breaking repo-surgery would be required, going
> back before 8ea9013512 (just doing a revert patch won't accomplish
> anything different).
I've saved the entire zfs filesystem tree in a zfs-send stream for more
experimentation later. Hopefully my notes above are of some value to
someone.
--
Cheers,
Cy Schubert <Cy.Schubert at cschubert.com>
FreeBSD UNIX: <cy at FreeBSD.org> Web: https://FreeBSD.org
NTP: <cy at nwtime.org> Web: https://nwtime.org
The need of the many outweighs the greed of the few.
More information about the dev-commits-src-all
mailing list