mailing list mirror (one of many)
 help / Atom feed
From: Stefan Beller <>
To: Junio C Hamano <>
Cc:, git <>
Subject: Re: query on git submodule (ignore)
Date: Mon, 26 Mar 2018 18:55:31 +0000
Message-ID: <> (raw)
In-Reply-To: <>

On Sun, Mar 25, 2018 at 9:46 AM Junio C Hamano <> wrote:

> prashant Nidgunde <> writes:

> [cc: stefan, for his interest in improving 'git submodules']

> > Hello,
> >
> > I am new to this community ,so please ignore if I am asking anything
> >
> > Case :
> > Today when I built my submodule , and did a git status , it shows as
> >
> > After reading certain suggestions on web i found out that i can ignore
> > that adding a line in .gitmodules
> >
> > But, I had to add that line manually ( which could be errorprone
> > because of typos )
> >
> >
> > Question:
> >     1. Is it feasible to build a feature like :
> >                    git submodule "zlib" ignore dirty ( which will
> > ignore submodule zlib when its built and dirty  as it has new files in
> > its directory)

> How does it prevent you from saying

>          git submodule "glib" ignore dirty

> when you really meant "zlib"?  How is the command supposed to know
> that you did *not* mean "glib", which may currently not exist in the
> index nor in the working tree yet but you are about to create, and
> doing the "ignore dirty" configuration as an earlier step of
> multiple steps to add a submodule?

> I personally doubt that the main issue you should be concerned about
> is feasibility.  A larger issue is how it is supposed to help, iow,
> is such a "feature" useful in the first place?

> Whenever you hear yourself say "I have to do X manually, and I can
> make mistakes. Can a command do it instead?", you have to ask
> yourself: what pieces of information do you give to that command,
> and how do you ensure you do not make typos on that command line?

> Besides, the above syntax would not work.  What would a user do when
> a submodule called "add" exists, for example?

I would think this can be solved by reordering the command to be

   git submodule ignore [--option-for-granularity=dirty] [-- <path-spec>]

However for now this would be a shallow wrapper to

   name=$(git submodule--helper name <one submodule path>)
   git config submodule.$name.ignore dirty

if I understand the requested feature correctly?
Instead of coming up with each name for each submodule path
(btw name and path are most often the same any way,
just put it here for correctness), one could also use

   git submodule foreach -- \
       git -C .. config submodule.$name.ignore dirty

as the foreach already populates the $name variable.


      reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-25  2:17 prashant Nidgunde
2018-03-25  7:10 ` Jacob Keller
2018-03-25 16:46 ` Junio C Hamano
2018-03-26 18:55   ` Stefan Beller [this message]

Reply instructions:

You may reply publically 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:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:

 note: .onion URLs require Tor:
       or Tor2web:

AGPL code for this site: git clone public-inbox