git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Brandon Williams <bmwill@google.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Jonathan Tan <jonathantanmy@google.com>,
	Philip Oakley <philipoakley@iee.org>
Subject: Re: [PATCHv2 4/4] builtin/reset: add --recurse-submodules switch
Date: Wed, 19 Apr 2017 12:08:24 -0700	[thread overview]
Message-ID: <CAGZ79kZ4oJcCD5QttcSzkfTVotust8vnBmSbp0sh5PrpqMQgJw@mail.gmail.com> (raw)
In-Reply-To: <xmqqfuh5av47.fsf@gitster.mtv.corp.google.com>

On Tue, Apr 18, 2017 at 9:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>> git-reset is yet another working tree manipulator, which should
>> be taught about submodules.
>>
>> One use case of "git-reset" is to reset to a known good state,
>> and dropping commits that did not work as expected.
>>
>> In that case one of the expected outcomes from a hard reset
>> would be to have broken submodules reset to a known good
>> state as well.  A test for this was added in a prior patch.
>
> When "git reset --hard" at the top-level superproject updates a
> gitlink in the index to a commit that was different from what was
> checked out in the working tree of the submodule, what should
> happen?

We reset the submodule to the commit as recorded in the superproject,
detaching its HEAD.


>  Do we reset the tip of the current branch in the submodule
> to point at the commit the index of the top-level records?  Do we
> detach the HEAD in the submodule to point at the commit?  Something
> else that is configurable?  Or do we just run "git reset --hard"
> in each submodule (which may leave submodule's HEAD different from
> what is recorded in the index of the superproject)?
>
> "... to a known good state as well" does not help answering the above.

I agree.

>

  reply	other threads:[~2017-04-19 19:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 21:37 [PATCHv2 0/4] recursive submodules: git-reset! Stefan Beller
2017-04-18 21:37 ` [PATCHv2 1/4] entry.c: submodule recursing: respect force flag correctly Stefan Beller
2017-04-18 21:37 ` [PATCHv2 2/4] submodule.c: uninitialized submodules are ignored in recursive commands Stefan Beller
2017-04-18 21:37 ` [PATCHv2 3/4] submodule.c: submodule_move_head works with broken submodules Stefan Beller
2017-04-18 21:37 ` [PATCHv2 4/4] builtin/reset: add --recurse-submodules switch Stefan Beller
2017-04-19  4:18   ` Junio C Hamano
2017-04-19 19:08     ` Stefan Beller [this message]
2017-04-21 17:39       ` [PATCHv3 " Stefan Beller
2017-04-20 19:41 ` [PATCHv2 0/4] recursive submodules: git-reset! Brandon Williams
2017-04-20 20:00   ` Stefan Beller

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAGZ79kZ4oJcCD5QttcSzkfTVotust8vnBmSbp0sh5PrpqMQgJw@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.com \
    --cc=jrnieder@gmail.com \
    --cc=philipoakley@iee.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).