<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.h, branch v1.6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2009-02-18T19:04:19Z</updated>
<entry>
<title>Turn the flags in struct dir_struct into a single variable</title>
<updated>2009-02-18T19:04:19Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2009-02-16T12:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c4c97c0ac0cd66861d0c2b8bd7a47ed3c523ea7'/>
<id>urn:sha1:7c4c97c0ac0cd66861d0c2b8bd7a47ed3c523ea7</id>
<content type='text'>
By having flags represented as bits in the new member variable 'flags',
it will be easier to use parse_options when dir_struct is involved.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Allow cloning to an existing empty directory</title>
<updated>2009-01-11T21:26:29Z</updated>
<author>
<name>Alexander Potashev</name>
<email>aspotashev@gmail.com</email>
</author>
<published>2009-01-11T12:19:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=55892d23981917aefdb387ad7d0429f90cbd446a'/>
<id>urn:sha1:55892d23981917aefdb387ad7d0429f90cbd446a</id>
<content type='text'>
The die() message updated accordingly.

The previous behaviour was to only allow cloning when the destination
directory doesn't exist.

[jc: added trivial tests]

Signed-off-by: Alexander Potashev &lt;aspotashev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add is_dot_or_dotdot inline function</title>
<updated>2009-01-11T21:21:57Z</updated>
<author>
<name>Alexander Potashev</name>
<email>aspotashev@gmail.com</email>
</author>
<published>2009-01-10T12:07:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ca12c0d62c0be4a4987c4a936467ea2a92e915a'/>
<id>urn:sha1:8ca12c0d62c0be4a4987c4a936467ea2a92e915a</id>
<content type='text'>
A new inline function is_dot_or_dotdot is used to check if the
directory name is either "." or "..". It returns a non-zero value if
the given string is "." or "..". It's applicable to a lot of Git
source code.

Signed-off-by: Alexander Potashev &lt;aspotashev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: make dir_add_name() and dir_add_ignored() static</title>
<updated>2008-10-03T00:46:09Z</updated>
<author>
<name>Nanako Shiraishi</name>
<email>nanako3@lavabit.com</email>
</author>
<published>2008-10-02T10:14:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=159b3212705f0f98c79a5565c0f9eff07234c1c7'/>
<id>urn:sha1:159b3212705f0f98c79a5565c0f9eff07234c1c7</id>
<content type='text'>
These functions are not used by any other file.

Signed-off-by: Nanako Shiraishi &lt;nanako3@lavabit.com&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
<entry>
<title>Add remove_path: a function to remove as much as possible of a path</title>
<updated>2008-09-29T15:37:07Z</updated>
<author>
<name>Alex Riesen</name>
<email>raa.lkml@gmail.com</email>
</author>
<published>2008-09-26T22:56:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4a92d1bfb784b09641180d164e7d719080165dc4'/>
<id>urn:sha1:4a92d1bfb784b09641180d164e7d719080165dc4</id>
<content type='text'>
The function has two potential users which both managed to get wrong
their implementations (the one in builtin-rm.c one has a memleak, and
builtin-merge-recursive.c scribles over its const argument).

Signed-off-by: Alex Riesen &lt;raa.lkml@gmail.com&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
<entry>
<title>gitignore: lazily find dtype</title>
<updated>2008-02-05T08:46:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-02-01T04:23:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6831a88ac03759a8133f10ffd52ad235a081a8a3'/>
<id>urn:sha1:6831a88ac03759a8133f10ffd52ad235a081a8a3</id>
<content type='text'>
When we process "foo/" entries in gitignore files on a system
that does not have d_type member in "struct dirent", the earlier
implementation ran lstat(2) separately when matching with
entries that came from the command line, in-tree .gitignore
files, and $GIT_DIR/info/excludes file.

This optimizes it by delaying the lstat(2) call until it becomes
absolutely necessary.

The initial idea for this change was by Jeff King, but I
optimized it further to pass pointers to around.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitignore(5): Allow "foo/" in ignore list to match directory "foo"</title>
<updated>2008-02-05T08:46:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-01-31T09:17:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d6b8fc303b389b026f2bf9918f6f83041488989b'/>
<id>urn:sha1:d6b8fc303b389b026f2bf9918f6f83041488989b</id>
<content type='text'>
A pattern "foo/" in the exclude list did not match directory
"foo", but a pattern "foo" did.  This attempts to extend the
exclude mechanism so that it would while not matching a regular
file or a symbolic link "foo".  In order to differentiate a
directory and non directory, this passes down the type of path
being checked to excluded() function.

A downside is that the recursive directory walk may need to run
lstat(2) more often on systems whose "struct dirent" do not give
the type of the entry; earlier it did not have to do so for an
excluded path, but we now need to figure out if a path is a
directory before deciding to exclude it.  This is especially bad
because an idea similar to the earlier CE_UPTODATE optimization
to reduce number of lstat(2) calls would by definition not apply
to the codepaths involved, as (1) directories will not be
registered in the index, and (2) excluded paths will not be in
the index anyway.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>per-directory-exclude: lazily read .gitignore files</title>
<updated>2007-11-29T10:19:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-11-29T10:17:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=63d285c8494d03a08600bb4453fcce077ecdd517'/>
<id>urn:sha1:63d285c8494d03a08600bb4453fcce077ecdd517</id>
<content type='text'>
Operations that walk directories or trees, which potentially need to
consult the .gitignore files, used to always try to open the .gitignore
file every time they entered a new directory, even when they ended up
not needing to call excluded() function to see if a path in the
directory is ignored.  This was done by push/pop exclude_per_directory()
functions that managed the data in a stack.

This changes the directory walking API to remove the need to call these
two functions.  Instead, the directory walk data structure caches the
data used by excluded() function the last time, and lazily reuses it as
much as possible.  Among the data the last check used, the ones from
deeper directories that the path we are checking is outside are
discarded, data from the common leading directories are reused, and then
the directories between the common directory and the directory the path
being checked is in are checked for .gitignore file.  This is very
similar to the way gitattributes are handled.

This API change also fixes "ls-files -c -i", which called excluded()
without setting up the gitignore data via the old push/pop functions.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>core.excludesfile clean-up</title>
<updated>2007-11-14T23:08:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-11-14T08:05:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=039bc64e886716593d59910694a6c8ed5b72c515'/>
<id>urn:sha1:039bc64e886716593d59910694a6c8ed5b72c515</id>
<content type='text'>
There are inconsistencies in the way commands currently handle
the core.excludesfile configuration variable.  The problem is
the variable is too new to be noticed by anything other than
git-add and git-status.

 * git-ls-files does not notice any of the "ignore" files by
   default, as it predates the standardized set of ignore files.
   The calling scripts established the convention to use
   .git/info/exclude, .gitignore, and later core.excludesfile.

 * git-add and git-status know about it because they call
   add_excludes_from_file() directly with their own notion of
   which standard set of ignore files to use.  This is just a
   stupid duplication of code that need to be updated every time
   the definition of the standard set of ignore files is
   changed.

 * git-read-tree takes --exclude-per-directory=&lt;gitignore&gt;,
   not because the flexibility was needed.  Again, this was
   because the option predates the standardization of the ignore
   files.

 * git-merge-recursive uses hardcoded per-directory .gitignore
   and nothing else.  git-clean (scripted version) does not
   honor core.* because its call to underlying ls-files does not
   know about it.  git-clean in C (parked in 'pu') doesn't either.

We probably could change git-ls-files to use the standard set
when no excludes are specified on the command line and ignore
processing was asked, or something like that, but that will be a
change in semantics and might break people's scripts in a subtle
way.  I am somewhat reluctant to make such a change.

On the other hand, I think it makes perfect sense to fix
git-read-tree, git-merge-recursive and git-clean to follow the
same rule as other commands.  I do not think of a valid use case
to give an exclude-per-directory that is nonstandard to
read-tree command, outside a "negative" test in the t1004 test
script.

This patch is the first step to untangle this mess.

The next step would be to teach read-tree, merge-recursive and
clean (in C) to use setup_standard_excludes().

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Speedup scanning for excluded files.</title>
<updated>2007-10-30T00:03:11Z</updated>
<author>
<name>Lars Knoll</name>
<email>lars@trolltech.com</email>
</author>
<published>2007-10-28T20:27:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=68492fc73b7387fa72d09545f5743728c5fdb419'/>
<id>urn:sha1:68492fc73b7387fa72d09545f5743728c5fdb419</id>
<content type='text'>
Try to avoid a lot of work scanning for excluded files,
by caching some more information when setting up the exclusion
data structure.

Speeds up 'git runstatus' on a repository containing the Qt sources by 30% and
reduces the amount of instructions executed (as measured by valgrind) by a
factor of 2.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
