Skip to content

Commit c2f2dab

Browse files
chriscoolpaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent a80e82f commit c2f2dab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ proc unmerged_files {files} {
130130
}
131131

132132
proc parseviewargs {n arglist} {
133-
global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs
133+
global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env
134134

135135
set vdatemode($n) 0
136136
set vmergeonly($n) 0
@@ -210,6 +210,9 @@ proc parseviewargs {n arglist} {
210210
# git rev-parse doesn't understand --merge
211211
lappend revargs --gitk-symmetric-diff-marker MERGE_HEAD...HEAD
212212
}
213+
"--no-replace-objects" {
214+
set env(GIT_NO_REPLACE_OBJECTS) "1"
215+
}
213216
"-*" {
214217
# Other flag arguments including -<n>
215218
if {[string is digit -strict [string range $arg 1 end]]} {

0 commit comments

Comments
 (0)