git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mv: Fix spurious warning when moving a file in presence of submodules

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 17, 2013, 18:24 UTC
Message-ID
<20131017182405.GR9464@google.com>
In-Reply-To
<525A8965.3040407@web.de>
Jens Lehmann wrote:
Show 7 quoted lines
> In commit 0656781fa "git mv" learned to update the submodule path in the
> .gitmodules file when moving a submodule in the work tree. But since that
> commit update_path_in_gitmodules() gets called no matter if we moved a
> submodule or a regular file, which is wrong and leads to a bogus warning
> when moving a regular file in a repo containing a .gitmodules file:
>
>     warning: Could not find section in .gitmodules where path=<filename>
[...]
> Reported-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
> ---
[...]
> And this is the fix for it, which I believe is stuff for maint.

Thanks again, and sorry to leave this hanging. I had some vague ideas for improvement:

 * style nits: test is a little long, making it hard to take in at a
   glance; tests tend to try to avoid pipelines to avoid losing the
   exit code from git commands; usual style is to use "test" instead
   of "[" consistently
 * would be nice to have another test that makes sure the "move a
   file, not submodule" case keeps working

But those can easily happen as changes on top, and as you mentioned, it's probably worth someone interested (e.g., me :)) making a pass to clean up the style of the rest of the script anyway.

The patch as-is is obviously good. Thanks again for the quick diagnosis and fix.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Previous: Matthieu Moy
Message 8 of 8 in “Spurious warning when moving a file in presence of submodules”
  1. Matthieu MoyOct 11, 2013
  2. Jens LehmannOct 11, 2013
  3. mv: Fix spurious warning when moving a file in presence of submodulesJens Lehmann, Oct 13, 2013
  4. Matthieu MoyOct 13, 2013
  5. Jens LehmannOct 13, 2013
  6. Jonathan NiederOct 14, 2013
  7. Matthieu MoyOct 14, 2013
  8. Jonathan NiederOct 17, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.