Re: git merge, .gitignore, and silently overwriting untracked files

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Tuesday, August 17, 2010 - 12:33 pm

There are only two kinds of untracked paths in git.  Ones that git is
allowed to remove in order to carry out operations asked by the end user,
i.e. ones that are trashable, are registered to the gitignore mechanism,
and the ones that are precious are not in gitignore; the latter can
interfere with git and prevent it from carrying out certain operations.
E.g. an untracked and unignored file F will prevent you from switching to
a branch that has file F tracked, or that has file F/G (iow, F is a
directory in that branch) tracked.

Ancient git didn't honor gitignore and considered no files trashable,
which caused a lot of trouble to users.  It may be illuminating to check
discussions in the list archive during the period the following commits
were made.  f8a9d42 (read-tree: further loosen "working file will be lost"
check., 2006-12-04), ed93b44 (merge: loosen overcautious "working file
will be lost" check., 2006-10-08), c819353 (Fix switching to a branch with
D/F when current branch has file D., 2007-03-15).

We could enhance the mechanism to categorize untracked paths into three
instead of two: trashable, unknown and precious.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: git merge, .gitignore, and silently overwriting untrac ..., Junio C Hamano, (Tue Aug 17, 12:33 pm)
[PATCH] optionally disable overwriting of ignored files, Clemens Buchacher, (Wed Aug 18, 4:39 pm)
Re: [PATCH] optionally disable overwriting of ignored files, Clemens Buchacher, (Fri Aug 20, 11:48 am)
[PATCH v2] optionally disable overwriting of ignored files, Clemens Buchacher, (Fri Aug 20, 11:48 pm)
Re: [PATCH] optionally disable overwriting of ignored files, Clemens Buchacher, (Sat Aug 21, 1:05 am)
Re: [PATCH] optionally disable overwriting of ignored files, Clemens Buchacher, (Sat Aug 21, 6:23 am)
Re: [PATCH] optionally disable overwriting of ignored files, Junio C Hamano, (Sun Aug 22, 12:25 am)
Re: [PATCH] optionally disable overwriting of ignored files, Clemens Buchacher, (Sun Aug 22, 1:20 am)
Re: [PATCH] optionally disable overwriting of ignored files, Holger Hellmuth, (Mon Aug 23, 6:56 am)
Re: [PATCH] optionally disable overwriting of ignored files, Clemens Buchacher, (Mon Aug 23, 8:11 am)
Re: [PATCH] optionally disable overwriting of ignored files, Clemens Buchacher, (Tue Aug 24, 12:28 am)
[PATCH 0/5] do not overwrite untracked files in leading path, Clemens Buchacher, (Sat Oct 9, 6:52 am)
[PATCH 1/5] t7607: use test_commit and test_must_fail, Clemens Buchacher, (Sat Oct 9, 6:52 am)
[PATCH 2/5] t7607: add leading-path tests, Clemens Buchacher, (Sat Oct 9, 6:52 am)
[PATCH 3/5] add function check_ok_to_remove(), Clemens Buchacher, (Sat Oct 9, 6:52 am)
[PATCH 4/5] lstat_cache: optionally return match_len, Clemens Buchacher, (Sat Oct 9, 6:52 am)
[PATCH 5/5] do not overwrite files in leading path, Clemens Buchacher, (Sat Oct 9, 6:53 am)
Re: [PATCH 2/5] t7607: add leading-path tests, Johannes Sixt, (Sat Oct 9, 12:14 pm)
Re: [PATCH 1/5] t7607: use test_commit and test_must_fail, Jonathan Nieder, (Sat Oct 9, 11:35 pm)
[PATCH 1/5 v2] t7607: use test-lib functions and check MER ..., Clemens Buchacher, (Sun Oct 10, 1:35 am)
[PATCH 2/5 v2] t7607: add leading-path tests, Clemens Buchacher, (Sun Oct 10, 1:38 am)
Re: [PATCH 3/5] add function check_ok_to_remove(), Junio C Hamano, (Wed Oct 13, 2:43 pm)
Re: [PATCH 5/5] do not overwrite files in leading path, Junio C Hamano, (Wed Oct 13, 2:57 pm)
Re: [PATCH 5/5] do not overwrite files in leading path, Clemens Buchacher, (Wed Oct 13, 3:34 pm)
Re: [PATCH 5/5] do not overwrite files in leading path, Clemens Buchacher, (Thu Oct 14, 11:48 pm)
Re: [PATCH 5/5] do not overwrite files in leading path, Junio C Hamano, (Fri Oct 15, 11:47 am)