threads / discuss / 35013

Feature request: Config option for --no-ignore-removal/--ignore-removal

Subject: Feature request: Config option for --no-ignore-removal/--ignore-removal

## tl;dr

3 messages between Sep 25, 2013 and Oct 17, 2013.

replies: 2people: 3as markdown or json

Matthew Cline· Sep 25, 2013, 04:01 UTC · lore

When I try to a plain old "git add ." when files have been deleted/moved, I get the warning

> You ran 'git add' with neither '-A (--all)' or '--ignore-removal'

There should be some way to put something in ~/.gitconfig to tell git to always choose one or another.

Junio C Hamano· Oct 16, 2013, 21:38 UTC · re: Matthew Cline · lore

Re: Feature request: Config option for --no-ignore-removal/--ignore-removal

Matthew Cline <matt@nightrealms.com> writes:
Show 7 quoted lines
> When I try to a plain old "git add ." when files have been
> deleted/moved, I get the warning
>
>> You ran 'git add' with neither '-A (--all)' or '--ignore-removal'
>
> There should be some way to put something in ~/.gitconfig to tell git to
> always choose one or another.
The lack of configurability is very much deliberate.

Adding such knobs that make basic behaviour of Git different depending on the per-user setting will make it unnecessarily harder to run to help your coworker when she is having problems. "git add directory" you type in her terminal during the session to help her could work differently from the way you are used to, if we added such a knob. We will not be making that mistake.

As the advice message says, "git add directory" ignores removed files in the directory in the current version, and in Git 2.0, the removals are recorded in the index with such a command, so that "add directory" records the state of the directory as a whole to the index, which is more consistent.

And that works for everybody the same way; the only way to prepare for you not to be negatively affected by the switchover is to train your fingers to say --all or --ignore-removal when the difference in behaviour in the current and future versions matters, hence this advise.

Felipe Contreras· Oct 17, 2013, 00:31 UTC · re: Junio C Hamano · lore

Re: Feature request: Config option for --no-ignore-removal/--ignore-removal

Junio C Hamano wrote:
Show 18 quoted lines
> Matthew Cline <matt@nightrealms.com> writes:
> 
> > When I try to a plain old "git add ." when files have been
> > deleted/moved, I get the warning
> >
> >> You ran 'git add' with neither '-A (--all)' or '--ignore-removal'
> >
> > There should be some way to put something in ~/.gitconfig to tell git to
> > always choose one or another.
> 
> The lack of configurability is very much deliberate.
> 
> Adding such knobs that make basic behaviour of Git different
> depending on the per-user setting will make it unnecessarily harder
> to run to help your coworker when she is having problems.  "git add
> directory" you type in her terminal during the session to help her
> could work differently from the way you are used to, if we added
> such a knob.

That's going to happen regardless. You are assuming she is running Git v2.0, which she might not.

-- 
Felipe Contreras

← back to recent threads