<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
<head>\r
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
-<meta name="generator" content="AsciiDoc 7.0.1" />\r
+<meta name="generator" content="AsciiDoc 7.0.2" />\r
<style type="text/css">\r
/* Debug borders */\r
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
</div>\r
<h2>SYNOPSIS</h2>\r
<div class="sectionbody">\r
-<p><em>git-update-index</em>\r
+<div class="verseblock">\r
+<div class="content"><em>git-update-index</em>\r
[--add] [--remove | --force-remove] [--replace]\r
[--refresh [-q] [--unmerged] [--ignore-missing]]\r
[--cacheinfo <mode> <object> <file>]*\r
[--chmod=(+|-)x]\r
+ [--assume-unchanged | --no-assume-unchanged]\r
+ [--really-refresh]\r
[--info-only] [--index-info]\r
[-z] [--stdin]\r
[--verbose]\r
- [--] [<file>]*</p>\r
+ [--] [<file>]*</div></div>\r
</div>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
</p>\r
</dd>\r
<dt>\r
+--assume-unchanged, --no-assume-unchanged\r
+</dt>\r
+<dd>\r
+<p>\r
+ When these flags are specified, the object name recorded\r
+ for the paths are not updated. Instead, these options\r
+ sets and unsets the "assume unchanged" bit for the\r
+ paths. When the "assume unchanged" bit is on, git stops\r
+ checking the working tree files for possible\r
+ modifications, so you need to manually unset the bit to\r
+ tell git when you change the working tree file. This is\r
+ sometimes helpful when working with a big project on a\r
+ filesystem that has very slow lstat(2) system call\r
+ (e.g. cifs).\r
+</p>\r
+</dd>\r
+<dt>\r
--info-only\r
</dt>\r
<dd>\r
100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2 frotz</tt></pre>\r
</div></div>\r
</div>\r
+<h2>Using "assume unchanged" bit</h2>\r
+<div class="sectionbody">\r
+<p>Many operations in git depend on your filesystem to have an\r
+efficient <tt>lstat(2)</tt> implementation, so that <tt>st_mtime</tt>\r
+information for working tree files can be cheaply checked to see\r
+if the file contents have changed from the version recorded in\r
+the index file. Unfortunately, some filesystems have\r
+inefficient <tt>lstat(2)</tt>. If your filesystem is one of them, you\r
+can set "assume unchanged" bit to paths you have not changed to\r
+cause git not to do this check. Note that setting this bit on a\r
+path does not mean git will check the contents of the file to\r
+see if it has changed — it makes git to omit any checking and\r
+assume it has <strong>not</strong> changed. When you make changes to working\r
+tree files, you have to explicitly tell git about it by dropping\r
+"assume unchanged" bit, either before or after you modify them.</p>\r
+<p>In order to set "assume unchanged" bit, use <tt>--assume-unchanged</tt>\r
+option. To unset, use <tt>--no-assume-unchanged</tt>.</p>\r
+<p>The command looks at <tt>core.ignorestat</tt> configuration variable. When\r
+this is true, paths updated with <tt>git-update-index paths…</tt> and\r
+paths updated with other git commands that update both index and\r
+working tree (e.g. <tt>git-apply --index</tt>, <tt>git-checkout-index -u</tt>,\r
+and <tt>git-read-tree -u</tt>) are automatically marked as "assume\r
+unchanged". Note that "assume unchanged" bit is <strong>not</strong> set if\r
+<tt>git-update-index --refresh</tt> finds the working tree file matches\r
+the index (use <tt>git-update-index --really-refresh</tt> if you want\r
+to mark them as "assume unchanged").</p>\r
+</div>\r
<h2>Examples</h2>\r
<div class="sectionbody">\r
<p>To update and refresh only the files already checked out:</p>\r
<div class="content">\r
<pre><tt>$ git-checkout-index -n -f -a && git-update-index --ignore-missing --refresh</tt></pre>\r
</div></div>\r
+<dl>\r
+<dt>\r
+On an inefficient filesystem with <tt>core.ignorestat</tt> set\r
+</dt>\r
+<dd>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>$ git update-index --really-refresh <b>(1)</b>\r
+$ git update-index --no-assume-unchanged foo.c <b>(2)</b>\r
+$ git diff --name-only <b>(3)</b>\r
+$ edit foo.c\r
+$ git diff --name-only <b>(4)</b>\r
+M foo.c\r
+$ git update-index foo.c <b>(5)</b>\r
+$ git diff --name-only <b>(6)</b>\r
+$ edit foo.c\r
+$ git diff --name-only <b>(7)</b>\r
+$ git update-index --no-assume-unchanged foo.c <b>(8)</b>\r
+$ git diff --name-only <b>(9)</b>\r
+M foo.c</tt></pre>\r
+</div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+forces lstat(2) to set "assume unchanged" bits for paths that match index.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+mark the path to be edited.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+this does lstat(2) and finds index matches the path.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+this does lstat(2) and finds index does <strong>not</strong> match the path.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+registering the new version to index sets "assume unchanged" bit.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+and it is assumed unchanged.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+even after you edit it.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+you can tell about the change after the fact.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+now it checks with lstat(2) and finds it has been changed.\r
+</p>\r
+</li>\r
+</ol>\r
+</dd>\r
+</dl>\r
</div>\r
<h2>Configuration</h2>\r
<div class="sectionbody">\r
in the index and the file mode on the filesystem if they differ only on\r
executable bit. On such an unfortunate filesystem, you may\r
need to use <tt>git-update-index --chmod=</tt>.</p>\r
+<p>The command looks at <tt>core.ignorestat</tt> configuration variable. See\r
+<em>Using "assume unchanged" bit</em> section above.</p>\r
</div>\r
<h2>See Also</h2>\r
<div class="sectionbody">\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 27-Dec-2005 00:16:52 PDT\r
+Last updated 29-Apr-2006 07:01:35 UTC\r
</div>\r
</div>\r
</body>\r