Skip to contentSkip to conversation

update-index --again

PATCH/RFC (git-core) Junio C Hamano 1 participant 1 message Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

After running 'git-update-index' for some paths, you may want to do the update on the same set of paths again.

The new flag --again checks the paths whose index entries are are different from the HEAD commit and updates them from the working tree contents.

This was brought up by Carl Worth on #git.

---

* I want to reorganize index file to contain both blob and tree entries in not so distant future, so I probably should not be doing something like this which _would_ need rework when that happens, but I think what Carl wanted to do is a reasonable thing to ask.

http://colabti.de/irclogger/irclogger_log/git?date=2006-05-05,Fri&sel=16#l31

 Documentation/git-update-index.txt |    6 ++-
 t/t2101-update-index-reupdate.sh   |   73 ++++++++++++++++++++++++++++++++++++
 update-index.c                     |   56 ++++++++++++++++++++++++++--
 3 files changed, 131 insertions(+), 4 deletions(-)
Documentation/git-update-index.txt +5 -1
index 57177c7..d043e86 100644
@@ -15,7 +15,7 @@ SYNOPSIS
 	     [--cacheinfo <mode> <object> <file>]\*
 	     [--chmod=(+|-)x]
 	     [--assume-unchanged | --no-assume-unchanged]
-	     [--really-refresh] [--unresolve]
+	     [--really-refresh] [--unresolve] [--again]
 	     [--info-only] [--index-info]
 	     [-z] [--stdin]
 	     [--verbose]
@@ -80,6 +80,10 @@ OPTIONS
 	filesystem that has very slow lstat(2) system call
 	(e.g. cifs).
 
+--again::
+	Runs `git-update-index` itself on the paths whose index
+	entries are different from those from the `HEAD` commit.
+
 --unresolve::
 	Restores the 'unmerged' or 'needs updating' state of a
 	file during a merge if it was cleared by accident.
t/t2101-update-index-reupdate.sh new file +73 -0

73 lines not on this page · raw message

update-index.c +53 -3

83 lines not on this page · raw message

Signature · 1 line
1.3.2.g2749