All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Rose Kunkel <rose@rosekunkel.me>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Rose Kunkel <rose@rosekunkel.me>,
	git@vger.kernel.org
Subject: Re: [BUG] `git reset --hard` fails with `update = none` submodules
Date: Tue, 15 Jun 2021 17:57:18 -0700	[thread overview]
Message-ID: <CAKjYmsHD2MuTE+drebKichz_0wquPN8ZTLbiPkUCZJyLsSFh8Q@mail.gmail.com> (raw)
In-Reply-To: <YMlLGwScowX8eXeJ@camp.crustytoothpaste.net>

Running `git status` in the resulting repository gives
```
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
```

This is the output from the clone command:
```
Cloning into 'tree-sitter-langs'...
remote: Enumerating objects: 609, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 609 (delta 40), reused 58 (delta 24), pack-reused 526
Receiving objects: 100% (609/609), 117.17 KiB | 1.05 MiB/s, done.
Resolving deltas: 100% (322/322), done.
Submodule 'repos/agda'
(https://github.com/tree-sitter/tree-sitter-agda) registered for path
'repos/agda'
Submodule 'repos/bash'
(https://github.com/tree-sitter/tree-sitter-bash) registered for path
'repos/bash'
Submodule 'repos/c' (https://github.com/tree-sitter/tree-sitter-c)
registered for path 'repos/c'
Submodule 'repos/c-sharp'
(https://github.com/tree-sitter/tree-sitter-c-sharp) registered for
path 'repos/c-sharp'
Submodule 'repos/cpp' (https://github.com/tree-sitter/tree-sitter-cpp)
registered for path 'repos/cpp'
Submodule 'repos/css' (https://github.com/tree-sitter/tree-sitter-css)
registered for path 'repos/css'
Submodule 'repos/elm' (https://github.com/razzeee/tree-sitter-elm)
registered for path 'repos/elm'
Submodule 'repos/fluent'
(https://github.com/tree-sitter/tree-sitter-fluent) registered for
path 'repos/fluent'
Submodule 'repos/go' (https://github.com/tree-sitter/tree-sitter-go)
registered for path 'repos/go'
Submodule 'repos/html'
(https://github.com/tree-sitter/tree-sitter-html) registered for path
'repos/html'
Submodule 'repos/janet-simple'
(https://codeberg.org/sogaiu/tree-sitter-janet-simple) registered for
path 'repos/janet-simple'
Submodule 'repos/java'
(https://github.com/tree-sitter/tree-sitter-java) registered for path
'repos/java'
Submodule 'repos/javascript'
(https://github.com/tree-sitter/tree-sitter-javascript) registered for
path 'repos/javascript'
Submodule 'repos/jsdoc'
(https://github.com/tree-sitter/tree-sitter-jsdoc) registered for path
'repos/jsdoc'
Submodule 'repos/json'
(https://github.com/tree-sitter/tree-sitter-json) registered for path
'repos/json'
Submodule 'repos/julia'
(https://github.com/tree-sitter/tree-sitter-julia) registered for path
'repos/julia'
Submodule 'repos/ocaml'
(https://github.com/tree-sitter/tree-sitter-ocaml) registered for path
'repos/ocaml'
Submodule 'repos/php' (https://github.com/tree-sitter/tree-sitter-php)
registered for path 'repos/php'
Submodule 'repos/python'
(https://github.com/tree-sitter/tree-sitter-python) registered for
path 'repos/python'
Submodule 'repos/ruby'
(https://github.com/tree-sitter/tree-sitter-ruby) registered for path
'repos/ruby'
Submodule 'repos/rust'
(https://github.com/tree-sitter/tree-sitter-rust) registered for path
'repos/rust'
Submodule 'repos/scala'
(https://github.com/tree-sitter/tree-sitter-scala) registered for path
'repos/scala'
Submodule 'repos/swift'
(https://github.com/tree-sitter/tree-sitter-swift) registered for path
'repos/swift'
Submodule 'repos/typescript'
(https://github.com/tree-sitter/tree-sitter-typescript) registered for
path 'repos/typescript'
Skipping submodule 'repos/agda'
Skipping submodule 'repos/bash'
Skipping submodule 'repos/c'
Skipping submodule 'repos/c-sharp'
Skipping submodule 'repos/cpp'
Skipping submodule 'repos/css'
Skipping submodule 'repos/elm'
Skipping submodule 'repos/fluent'
Skipping submodule 'repos/go'
Skipping submodule 'repos/html'
Skipping submodule 'repos/janet-simple'
Skipping submodule 'repos/java'
Skipping submodule 'repos/javascript'
Skipping submodule 'repos/jsdoc'
Skipping submodule 'repos/json'
Skipping submodule 'repos/julia'
Skipping submodule 'repos/ocaml'
Skipping submodule 'repos/php'
Skipping submodule 'repos/python'
Skipping submodule 'repos/ruby'
Skipping submodule 'repos/rust'
Skipping submodule 'repos/scala'
Skipping submodule 'repos/swift'
Skipping submodule 'repos/typescript'
```

On Tue, Jun 15, 2021 at 5:51 PM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
>
> On 2021-06-16 at 00:16:06, Rose Kunkel wrote:
> > # What did you do before the bug happened? (Steps to reproduce your issue)
> > 1. Clone a git repository that sets `update = none` in .gitmodules:
> > $ git clone --recurse-submodules https://github.com/ubolonton/tree-sitter-langs
> >
> > 2. Perform a hard reset:
> > $ cd tree-sitter-langs
> > $ git reset --hard
> >
> > # What did you expect to happen? (Expected behavior)
> > The reset should succeed and do nothing.
>
> I think we're in agreement on this.  This should be a fresh clone and so
> a hard reset should change nothing.
>
> > # What happened instead? (Actual behavior)
> > The reset command fails with
> > ```
> > fatal: not a git repository: ../../.git/modules/repos/agda
> > fatal: could not reset submodule index
> > ```
>
> Hmmm, I can't reproduce this behavior.  What I see is this:
>
>   $ git reset --hard
>   HEAD is now at 5d362ce Release 0.10.0
>
> I'm running git version 2.32.0.272.g935e593368 on Debian sid (with the
> experimental packages).
>
> Can you try the clone and run a "git status" command in the repository
> to see if anything is modified after your clone?  Are the submodules
> checked out when you perform the clone?  In my case, I see lines like
> this:
>
>   Skipping submodule 'repos/agda'
>
> If you're seeing something different, then that might contribute to the
> different behavior we're seeing.
> --
> brian m. carlson (he/him or they/them)
> Toronto, Ontario, CA

  reply	other threads:[~2021-06-16  0:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  0:16 [BUG] `git reset --hard` fails with `update = none` submodules Rose Kunkel
2021-06-16  0:51 ` brian m. carlson
2021-06-16  0:57   ` Rose Kunkel [this message]
2021-06-16  1:03     ` Rose Kunkel
2021-06-16  1:15       ` Rose Kunkel
2021-06-16  1:25       ` brian m. carlson
2021-06-16  1:39         ` Rose Kunkel
2021-06-16  1:46           ` Rose Kunkel
2021-06-16  3:10         ` Junio C Hamano
2021-06-16 13:20           ` Philippe Blain
2021-06-17 23:52             ` brian m. carlson
2021-06-19 21:44               ` [PATCH] submodule: mark submodules with update=none as inactive brian m. carlson
2021-06-22  3:45                 ` Philippe Blain
2021-06-25 23:02                   ` brian m. carlson
2021-06-26 15:12                     ` Philippe Blain
2021-07-01 22:51               ` [PATCH v2] " brian m. carlson
2021-07-09 20:26                 ` Philippe Blain
2021-07-11 16:59                   ` brian m. carlson

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=CAKjYmsHD2MuTE+drebKichz_0wquPN8ZTLbiPkUCZJyLsSFh8Q@mail.gmail.com \
    --to=rose@rosekunkel.me \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.