All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sangeeta <sangunb09@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Phillip Wood <phillip.wood123@gmail.com>,
	Kaartic Sivaraam <kaartic.sivaraam@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [Outreachy][PATCH v6] diff: do not show submodule with untracked files as "-dirty"
Date: Tue, 3 Nov 2020 16:16:49 +0530	[thread overview]
Message-ID: <CAHjREB7W2P9_P4LoMHVVzV_YR5-_51zdbRZ0fpEDVkgkd7sh8w@mail.gmail.com> (raw)
In-Reply-To: <20201026175742.33356-1-sangunb09@gmail.com>

Hey Johannes and Junio,

In continuation of the discussion from here[1]

[1] https://lore.kernel.org/git/nycvar.QRO.7.76.6.2011020251520.18437@tvgsbejvaqbjf.bet/

> >> * sj/untracked-files-in-submodule-directory-is-not-dirty (2020-10-26) 1 commit
> >>  - diff: do not show submodule with untracked files as "-dirty"
> >>
> >>  "git diff" showed a submodule working tree with untracked cruft as
> >>  "Submodule commit <objectname>-dirty", but a natural expectation is
> >>  that the "-dirty" indicator would align with "git describe --dirty",
> >>  which does not consider having untracked files in the working tree
> >>  as source of dirtiness.  The inconsistency has been fixed.
> >>
> >>  Needs doc update.

Do I need to add the doc update in the same patch?

> > I *think* the original rationale for marking submodules with untracked
> > (_un-ignored_) files was to avoid deleting a submodule that has
> > uncommitted (because untracked) files.
>
> I agree with you that that the motivation was exactly that, but I
> have a suspicion that its execution was misguided.

I am really very sorry if I ended up adding some unwanted code.

>
> When one has a subdirectory D where one might or might not have an
> untracked new file that one does not want to lose, but one otherwise
> would want to clean up (perhaps an errant process created tons of
> garbage files in the directory), one would not
>
>         git diff D
>
> to see if there are important changes in that directory before doing
>
>         rm -rf D && git checkout D
>
> to bring it back to pristine state, exactly because one would not
> want to lose newly-created but not added files.  One would instead
> use
>
>         git status D
>
> for checking.  Why would a user change the habit when D happens to
> be a submodule?
>
> So I would say that "git status [D]", if it does not let the user
> notice that there is untracked contents in the submodule working
> tree, would be a bad idea.  "git diff" that ignores untracked paths
> in the submodule working tree, on the other hand, is a good thing.
>
> Now, the patch as-is may change the behaviour of "git status D" in
> this case, and the internal invocation of diff-files made somewhere
> in wt-status.c may have to be adjusted to keep such a submodule with
> forgotten newly created files shown as modified.
>
> Further discussion on this should be done on the original review
> thread for continuity, not here, in any case.
>

So we want that `git status` should behave in the same way as it was
behaving before? Can we do this by passing --ignore-submodules=none as
the default args for status? Another approach might be to figure out
how the diff is being called(like is this being called from git status
or git diff) and then add the --ignore-submodules=untracked behavior
to it accordingly. Though I have no idea how to do that now.

Please correct me if I am completely going in the wrong direction. As
it is my first time contributing to git, so any help would be greatly
beneficial for me.

Thanks and regards,
Sangeeta

  reply	other threads:[~2020-11-03 10:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 17:08 [PATCH] diff: do not show submodule with untracked files as "-dirty" Sangeeta via GitGitGadget
2020-10-20 13:38 ` [OUTREACHY][PATCH] " Phillip Wood
2020-10-20 18:10   ` Sangeeta NB
2020-10-21 11:28     ` Phillip Wood
2020-10-21 13:10 ` [Outreachy] [PATCH v2] " Sangeeta Jain
2020-10-21 17:43   ` Eric Sunshine
2020-10-21 19:40     ` Sangeeta NB
2020-10-21 23:04       ` Eric Sunshine
2020-10-22 11:22 ` [Outreachy] [PATCH v3] " Sangeeta Jain
2020-10-22 18:07   ` Junio C Hamano
2020-10-23  5:23     ` Sangeeta NB
2020-10-23 15:19       ` Junio C Hamano
2020-10-23 18:17         ` Sangeeta NB
2020-10-23 18:55           ` Junio C Hamano
2020-10-23 19:08             ` Sangeeta NB
2020-10-23 11:17 ` [PATCH v4] " Sangeeta Jain
2020-10-23 15:56   ` Junio C Hamano
2020-10-23 18:32     ` Sangeeta NB
2020-10-23 20:22       ` Junio C Hamano
2020-10-23 11:18 ` [Outreachy] " Sangeeta Jain
2020-10-23 21:28   ` Junio C Hamano
2020-10-25 10:23     ` Sangeeta NB
2020-10-26 17:36       ` Junio C Hamano
2020-10-23 19:29 ` [Outreachy] [PATCH v5] " Sangeeta Jain
2020-10-26 17:57 ` [Outreachy][PATCH v6] " Sangeeta Jain
2020-11-03 10:46   ` Sangeeta [this message]
2020-11-03 17:55     ` Junio C Hamano
2020-11-07 10:47       ` Sangeeta
2020-12-08 21:02         ` Junio C Hamano
2020-11-07 11:10   ` Đoàn Trần Công Danh
2020-11-09 15:19     ` Sangeeta
2020-11-09 17:01       ` Junio C Hamano
2020-11-10  8:39 ` [Outreachy][PATCH v7] " Sangeeta Jain
2020-11-10 17:09   ` Đoàn Trần Công Danh
2020-12-08 13:36   ` Sangeeta
2020-12-08 22:26     ` Junio C Hamano

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=CAHjREB7W2P9_P4LoMHVVzV_YR5-_51zdbRZ0fpEDVkgkd7sh8w@mail.gmail.com \
    --to=sangunb09@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kaartic.sivaraam@gmail.com \
    --cc=phillip.wood123@gmail.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 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.