All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brandon Casey <drafnel@gmail.com>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Brandon Casey <casey@nrlssc.navy.mil>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, johannes.schindelin@gmx.de
Subject: Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules
Date: Sun, 12 Sep 2010 14:10:00 -0500	[thread overview]
Message-ID: <AANLkTinMf-_vk2-gRazf-8FNykZoNbVwmu_+c+5ht8rY@mail.gmail.com> (raw)
In-Reply-To: <1094265482.7527324.1284144028114.JavaMail.fmail@mwmweb047>

On Fri, Sep 10, 2010 at 1:40 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
>>Brandon Casey <casey@nrlssc.navy.mil> writes:
>>
>>> From: Brandon Casey <drafnel@gmail.com>
>>>
>>> Since 'git describe' does not append -dirty to the version string it
>>> produces when untracked files exist in the working directory of the main
>>> repository, it should not do so for submodules either.
>>>
>>> Add --ignore-submodules=untracked to the call to diff-index which is used
>>> to decide whether or not the '-dirty' string is necessary.
>>>
>>> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
>>> ---
>>
>>Hmm, this changes the behaviour in a big way but it probably is for the
>>better.  At least it is consistent with the recent fixes to the
>>interaction between diff and submodules.
>
> Hmm, by default the diff family considers submodules with untracked files as
> dirty unless configured otherwise (and AFAICS the recent fixes to the interaction
> between diff and submodule were options to configure your own default).
>
> So when git status tells you the subodule is modified, e.g. because of an untracked
> file, I would expect git describe to add '-dirty' to its output when requested.

Triple hmm.  Perhaps a deeper level change is necessary than what I originally
thought.

It appears to me now, that the behavior of the entire diff family is
inconsistent
with respect to how untracked content is handled at the super-project level and
at the submodule level.

At the super-project level, git only considers as 'modified', changes to
_tracked_ content.  Any untracked content is ignored by git-describe, git-diff,
and friends, and git-status places it in its own 'Untracked files' section.

At the submodule level, all files, tracked and untracked, are considered.

> To get rid
> of that I would expect you either fix the .gitignore of the submodule or configure that
> you don't care about untracked files in submodules at all (either only for this
> submodule or in the config).
>
> So if I didn't misunderstand something here I would rather vote against this change,
> git describe should append a '-dirty' when git status would show modifications, no?

Do you agree that there is an inconsistency between how untracked content is
treated at the super-project level and at the submodule level?  Any thoughts
about how the behavior should be made to be consistent?

Perhaps the default setting of submodule.<name>.ignore should be 'untracked'?

-Brandon

  reply	other threads:[~2010-09-12 19:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 19:12 [PATCH] builtin/describe.c: ignore untracked changes in submodules Brandon Casey
2010-09-10  0:21 ` Junio C Hamano
2010-09-10 18:40   ` Jens Lehmann
2010-09-12 19:10     ` Brandon Casey [this message]
2010-09-13 17:59       ` Jens Lehmann
     [not found]       ` <1258122337.8606899.1284400767503.JavaMail.fmail@mwmweb047>
2010-09-13 18:18         ` Jens Lehmann
2010-09-13 23:14           ` Junio C Hamano
2010-09-14 20:30             ` Jens Lehmann
     [not found]   ` <1464835923.7527323.1284144028047.JavaMail.fmail@mwmweb047>
2010-09-11 18:11     ` Jens Lehmann
2010-09-11 19:13       ` Junio C Hamano
2010-09-11 20:23         ` Jens Lehmann
2010-09-12 17:44           ` Junio C Hamano
2010-09-12 20:07             ` Junio C Hamano
2010-09-12  2:22 ` yj2133011

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=AANLkTinMf-_vk2-gRazf-8FNykZoNbVwmu_+c+5ht8rY@mail.gmail.com \
    --to=drafnel@gmail.com \
    --cc=Jens.Lehmann@web.de \
    --cc=casey@nrlssc.navy.mil \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.