git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Git Mailing List <git@vger.kernel.org>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Paul Mackerras <paulus@samba.org>,
	Heiko Voigt <hvoigt@hvoigt.net>, Lars Hjemli <hjemli@gmail.com>,
	Avery Pennarun <apenwarr@gmail.com>
Subject: Re: submodules' shortcomings, was Re: RFC: display dirty submodule working directory in git gui and gitk
Date: Wed, 06 Jan 2010 22:19:20 +0100	[thread overview]
Message-ID: <4B44FE58.3030209@web.de> (raw)
In-Reply-To: <7vbph7uhn9.fsf@alter.siamese.dyndns.org>

Am 06.01.2010 21:01, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
> 
>> Am 06.01.2010 18:55, schrieb Junio C Hamano:
>>> I was envisioning that the "git status" in submodule will be run with its
>>> recent --porcelain option, and "git status" or "git commit" would read it
>>> to postprocess and incorporate into its own output.
>>
>> And i thought about printing just one line for each dirty submodule that
>> contains uncommitted and/or new files. I did not intend to list every
>> file, for the same reason a "git diff --submodule" only shows the first
>> line of the commit messages, not the actual differences of all changed
>> files in the submodule. I am not against being able to show all files
>> too, but i really would want to have an option to get a short output for
>> git gui and gitk.
> 
> I don't think what you are saying is inconsistent with "git status/commit
> that reads from 'git status --porcelain' it runs in a submodule directory,
> postprocesses it and incorporates it into its own output."  When the
> sub-status reports changes, your "postprocess" would condense it down to
> "this has a potential change that user could want to commit".  How the
> dirtiness is shown is entirely up to the caller that detected that change.
> 
> Let's explain it in another way.
> 
> The original "diff" for a submodule entry was implemented by preparing a
> 
> 	"Subproject commit %s\n"
> 
> line for the submodule commit recorded in the preimage and postimage, and
> compare these as if they are one-line files.  When the postimage was work
> tree, it looked at submodule's .git/HEAD to learn what to stuff in %s
> there.
> 
> But nobody forced you to limit the check only to .git/HEAD in the
> submodule.  To make the comparison richer, you could check if the
> submodule directory is dirty (and we have already discussed the potential
> definition of dirtiness earlier), and add "-dirty" in the string as well.
> With such a change, if you make some changes to a file in the work tree of
> the submodule after a clean "clone", "git diff" between the index and the
> work tree would report:
> 
> 	-Subproject commit 37bae10e38a66e4f1ddd5350daded00b21735126
> 	+Subproject commit 37bae10e38a66e4f1ddd5350daded00b21735126-dirty
> 
> The suggestion to read from "status --porcelain" that is run in the
> submodule directory was about how to implement the part that determines
> this "dirtiness" information, and not about how that dirtiness is
> expressed in the output.  The above is an illustration that even the
> traditional output format can be made aware of this submodule dirtiness
> check.  "diff --submodule" can express that dirtiness information in any
> way it wants.

I see, we seem to agree again :-)

While looking into "git status" in the last hours i became aware that
there is some infrastructure for calling "git submodule summary" (when
that is enabled via "git config status.submodulesummary"). I think this
can be extended to transfer the dirty information from "git diff
--submodule" (which can and should replace "git submodule summary" IMO)
into "git status".

Will send a patch for discussion tomorrow, i have to get some sleep now.

  reply	other threads:[~2010-01-06 21:20 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-02 15:33 RFC: display dirty submodule working directory in git gui and gitk Jens Lehmann
2010-01-04  9:44 ` Johannes Schindelin
2010-01-04 10:44   ` Heiko Voigt
2010-01-04 11:46     ` submodules, was " Johannes Schindelin
2010-01-04 18:29       ` Avery Pennarun
2010-01-04 19:14         ` Jens Lehmann
2010-01-04 17:04   ` Jens Lehmann
2010-01-04 22:29     ` submodules' shortcomings, was " Johannes Schindelin
2010-01-04 22:27       ` Shawn O. Pearce
2010-01-04 22:35         ` Avery Pennarun
2010-01-04 22:53       ` Avery Pennarun
2010-01-05  8:11       ` Jens Lehmann
2010-01-05  9:33         ` Junio C Hamano
2010-01-05 10:07           ` Johannes Schindelin
2010-01-05 11:57           ` Jens Lehmann
2010-01-05 18:31             ` Junio C Hamano
2010-01-05 20:01               ` Jens Lehmann
2010-01-06  1:04                 ` Junio C Hamano
2010-01-06 14:05                   ` Jens Lehmann
2010-01-06 17:01                     ` Junio C Hamano
2010-01-06 17:23                       ` Nguyen Thai Ngoc Duy
2010-01-06 17:55                         ` Junio C Hamano
2010-01-06 18:22                           ` Nguyen Thai Ngoc Duy
2010-01-06 18:32                           ` Jens Lehmann
2010-01-06 20:01                             ` Junio C Hamano
2010-01-06 21:19                               ` Jens Lehmann [this message]
2010-01-06 18:20                       ` Jens Lehmann
2010-01-05 23:02               ` Johannes Schindelin
2010-01-05  9:46         ` Johannes Schindelin
2010-01-05 12:19           ` Jens Lehmann
2010-01-05 14:27           ` Heiko Voigt
2010-01-05 15:07             ` Johan Herland
2010-01-05 15:30             ` Johannes Schindelin
2010-01-05 22:37             ` Nanako Shiraishi
2010-01-05 23:13               ` Johannes Schindelin
2010-01-07 11:04                 ` Nanako Shiraishi
2010-01-05 20:38       ` Pau Garcia i Quiles
2010-01-05 23:06         ` cmake, was Re: submodules' shortcomings Johannes Schindelin
2010-01-06  1:17           ` Pau Garcia i Quiles
2010-01-06  4:25             ` Miles Bader
2010-01-06  9:24             ` Johannes Schindelin
2010-01-04 17:51   ` RFC: display dirty submodule working directory in git gui and gitk Nguyen Thai Ngoc Duy
2010-01-04 18:40     ` Jens Lehmann
2010-01-04 19:05       ` Junio C Hamano
2010-01-04 19:21         ` Jens Lehmann

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=4B44FE58.3030209@web.de \
    --to=jens.lehmann@web.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hjemli@gmail.com \
    --cc=hvoigt@hvoigt.net \
    --cc=paulus@samba.org \
    --cc=pclouds@gmail.com \
    --cc=spearce@spearce.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.
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).