summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2017-11-16 16:38:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-17 01:31:05 (GMT)
commit9472935d81eaf9faed771878c9df0216ae0d9045 (patch)
tree9e8ed5c59d04b47defd123a1110fde0c38305328 /cache.h
parentcb5918aa0d50f50e83787f65c2ddc3dcb10159fe (diff)
downloadgit-9472935d81eaf9faed771878c9df0216ae0d9045.zip
git-9472935d81eaf9faed771878c9df0216ae0d9045.tar.gz
git-9472935d81eaf9faed771878c9df0216ae0d9045.tar.bz2
add: introduce "--renormalize"
Make it safer to normalize the line endings in a repository. Files that had been commited with CRLF will be commited with LF. The old way to normalize a repo was like this: # Make sure that there are not untracked files $ echo "* text=auto" >.gitattributes $ git read-tree --empty $ git add . $ git commit -m "Introduce end-of-line normalization" The user must make sure that there are no untracked files, otherwise they would have been added and tracked from now on. The new "add --renormalize" does not add untracked files: $ echo "* text=auto" >.gitattributes $ git add --renormalize . $ git commit -m "Introduce end-of-line normalization" Note that "git add --renormalize <pathspec>" is the short form for "git add -u --renormalize <pathspec>". While at it, document that the same renormalization may be needed, whenever a clean filter is added or changed. Helped-By: Junio C Hamano <gitster@pobox.com> Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 6440e2b..3e63a74 100644
--- a/cache.h
+++ b/cache.h
@@ -686,6 +686,7 @@ extern int ie_modified(const struct index_state *, const struct cache_entry *, s
#define HASH_WRITE_OBJECT 1
#define HASH_FORMAT_CHECK 2
+#define HASH_RENORMALIZE 4
extern int index_fd(struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
extern int index_path(struct object_id *oid, const char *path, struct stat *st, unsigned flags);