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

Re: [PATCH 1/3] diff options: Introduce --ignore-submodules

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 14, 2008, 18:42 UTC
Message-ID
<alpine.DEB.1.00.0805141940460.30431@racer>
In-Reply-To
<7vbq38oi3j.fsf@gitster.siamese.dyndns.org>
Hi,
On Wed, 14 May 2008, Junio C Hamano wrote:
Show 14 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > @@ -3355,6 +3357,9 @@ void diff_addremove(struct diff_options *options,
> >  	char concatpath[PATH_MAX];
> >  	struct diff_filespec *one, *two;
> >  
> > +	if (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(mode))
> > +		return;
> > +
> >  	/* This may look odd, but it is a preparation for
> >  	 * feeding "there are unchanged files which should
> >  	 * not produce diffs, but when you are doing copy
> 
> So both removal and addition of a submodule is an uninteresting event.
Yes.
Show 14 quoted lines
> > @@ -3399,6 +3404,10 @@ void diff_change(struct diff_options *options,
> >  	char concatpath[PATH_MAX];
> >  	struct diff_filespec *one, *two;
> >  
> > +	if (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(old_mode)
> > +			&& S_ISGITLINK(new_mode))
> > +		return;
> 
> And a submodule changing from revision A to B is uninteresting.
> 
> Is it interesting if something that used to be a blob turns into a
> submodule, or vice versa?  The code says it is, but I think it would be
> more convenient to treat it as a removal of blob and addition of a
> submodule.

The point is: for the sake of a script (which wants to ignore submodules) asking if there is a diff, I think it makes sense to not ignore those changes. IOW I think my patch is enough for the purpose of getting stash/rebase to behave.

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 12 in “sane rebase/stash support with submodules”
  1. 0/3 sane rebase/stash support with submodulesJohannes Schindelin, May 14, 2008
  2. 1/3 diff options: Introduce --ignore-submodulesJohannes Schindelin, May 14, 2008
  3. Junio C HamanoMay 14, 2008
  4. Johannes SchindelinMay 14, 2008
  5. Junio C HamanoMay 14, 2008
  6. Johannes SchindelinMay 14, 2008
  7. Junio C HamanoMay 14, 2008
  8. Johannes SchindelinMay 15, 2008
  9. Junio C HamanoMay 15, 2008
  10. Johannes SchindelinMay 15, 2008
  11. 2/3 Teach update-index about --ignore-submodulesJohannes Schindelin, May 14, 2008
  12. 3/3 Ignore dirty submodule states during rebase and stashJohannes Schindelin, May 14, 2008

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.