git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org
Subject: Re: Subject: [PATCH for submodule ideas wiki] `git commit` to warn about broken submodule states configuration
Date: Thu, 17 Mar 2016 20:57:01 +0100	[thread overview]
Message-ID: <56EB0C0D.3080609@web.de> (raw)
In-Reply-To: <1458162423-13768-1-git-send-email-sbeller@google.com>

Am 16.03.2016 um 22:07 schrieb Stefan Beller:
> ---
>
>    Hi Jens,
>
>    I cannot find the edit button in the wiki[1] any more.

Oops. After you mentioned recently that every GitHub user had write
permissions to the Wiki I restricted it to be writable for known
collaborators and also added you to this list. But it looks like I
added the other Stefan Beller registered on GitHub instead. That
should be fixed know, please let me know when the edit button still
does not show up for you.

>    Please apply this patch documenting another idea.

Sure, thanks for the patch! Applied and pushed.

>    Thanks,
>    Stefan
>
>    [1] https://github.com/jlehmann/git-submod-enhancements/wiki
>
>   Home.textile | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/Home.textile b/Home.textile
> index 152ad04..3b00496 100644
> --- a/Home.textile
> +++ b/Home.textile
> @@ -47,6 +47,17 @@ h2. Submodule related bugs to fix
>   * E.g. @git log <submodule>/@ and @git diff <rev> <submodule>/@ do not produce any output while dropping the '/' at the end makes them work as expected.
>   * @git add@ does not honour the submodule.&lt;name&gt;.ignore settings
>   * @git submodule add@ messes up paths from nested submodules, see ("thread on mailing list":http://thread.gmane.org/gmane.comp.version-control.git/288130)
> +* @git commit@ can be cautious about submodule related commits. That is if a commit contains a change to the .gitmodules file, make sure that the corresponding gitlink is present (either already in the tree or newly added). IIUC Jonathan correctly a submodule which is configured in .gitmodules, but not present as a gitlink is considered broken, which we may want to avoid in the first place. When implementing this, we need to take care of historical mistakes being handled correctly as well as a flag to commit, which overwrites the potential warning. The gitmodules file unlike other in-tree configuration files (.gitignore, .gitattributes, .mailmap) have a 1:1 mapping so the existence of the gitlink is strongly expected. (Counter example with .gitignore: Ignoring *.exe doesn't expect any .
 exe file to be there). I imagine this to roughly work as:
> +
> +bc.     $ git add .gitmodules
> +    $ git commit -m "add submodule to .gitmodules, but not as gitlink"
> +      Warning: Not committing as this would break submodule consistency. Use
> +      --force-submodules to commit the broken submodule state.
> +    $ echo $?
> +      1 # fail
> +    $ git commit --force-submodules -m "add submodule to .gitmodules, but not as gitlink"
> +    $ echo $?
> +      0 # Success
>
>   *[[Ideas]]*
>
>

      reply	other threads:[~2016-03-17 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 21:07 Subject: [PATCH for submodule ideas wiki] `git commit` to warn about broken submodule states configuration Stefan Beller
2016-03-17 19:57 ` Jens Lehmann [this message]

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=56EB0C0D.3080609@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.com \
    /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).