@matheusbsbs / matheus-bagliano / commits / c2f2dab971
Fork 0

gitk: Add "--no-replace-objects" option

Replace refs are useful to change some git objects after they have started to be shared between different repositories. One might want to ignore them to see the original state, and "--no-replace-objects" option can be used from the command line to do so. This option simply sets the GIT_NO_REPLACE_OBJECTS environment variable, and that is enough to make gitk ignore replace refs. The GIT_NO_REPLACE_OBJECTS is set to "1" instead of "" as it is safer on some platforms, thanks to Johannes Sixt and Michael J Gruber. Tested-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Paul Mackerras <paulus@samba.org>

Christian Couder committed Dec 12, 2009 at 05:52 UTC c2f2dab971d4e955dbf5a48055ed3cde4a078711
1 file changed +4 -1
gitk
+4 -1
@@ -130,7 +130,7 @@ proc unmerged_files {files} {
130 }
131
132 proc parseviewargs {n arglist} {
133 - global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs
133 + global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env
134
135 set vdatemode($n) 0
136 set vmergeonly($n) 0
@@ -210,6 +210,9 @@ proc parseviewargs {n arglist} {
210 # git rev-parse doesn't understand --merge
211 lappend revargs --gitk-symmetric-diff-marker MERGE_HEAD...HEAD
212 }
213 + "--no-replace-objects" {
214 + set env(GIT_NO_REPLACE_OBJECTS) "1"
215 + }
216 "-*" {
217 # Other flag arguments including -<n>
218 if {[string is digit -strict [string range $arg 1 end]]} {