Skip to content

Commit 29a9366

Browse files
logiclrdprati0100
authored andcommitted
git-gui: consolidate naming conventions
A few variables in this file use camelCase, while the overall standard is snake_case. A consistent naming scheme will improve readability of future changes. To avoid mixing naming changes with semantic changes, this commit contains only naming changes. Signed-off-by: Jonathan Gilbert <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
1 parent b524f6b commit 29a9366

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

lib/index.tcl

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ proc _close_updateindex {fd after} {
5656
uplevel #0 $after
5757
}
5858

59-
proc update_indexinfo {msg pathList after} {
59+
proc update_indexinfo {msg path_list after} {
6060
global update_index_cp
6161

6262
if {![lock_index update]} return
6363

6464
set update_index_cp 0
65-
set pathList [lsort $pathList]
66-
set totalCnt [llength $pathList]
67-
set batch [expr {int($totalCnt * .01) + 1}]
65+
set path_list [lsort $path_list]
66+
set total_cnt [llength $path_list]
67+
set batch [expr {int($total_cnt * .01) + 1}]
6868
if {$batch > 25} {set batch 25}
6969

7070
$::main_status start $msg [mc "files"]
@@ -78,26 +78,26 @@ proc update_indexinfo {msg pathList after} {
7878
fileevent $fd writable [list \
7979
write_update_indexinfo \
8080
$fd \
81-
$pathList \
82-
$totalCnt \
81+
$path_list \
82+
$total_cnt \
8383
$batch \
8484
$after \
8585
]
8686
}
8787

88-
proc write_update_indexinfo {fd pathList totalCnt batch after} {
88+
proc write_update_indexinfo {fd path_list total_cnt batch after} {
8989
global update_index_cp
9090
global file_states current_diff_path
9191

92-
if {$update_index_cp >= $totalCnt} {
92+
if {$update_index_cp >= $total_cnt} {
9393
_close_updateindex $fd $after
9494
return
9595
}
9696

9797
for {set i $batch} \
98-
{$update_index_cp < $totalCnt && $i > 0} \
98+
{$update_index_cp < $total_cnt && $i > 0} \
9999
{incr i -1} {
100-
set path [lindex $pathList $update_index_cp]
100+
set path [lindex $path_list $update_index_cp]
101101
incr update_index_cp
102102

103103
set s $file_states($path)
@@ -119,18 +119,18 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} {
119119
display_file $path $new
120120
}
121121

122-
$::main_status update $update_index_cp $totalCnt
122+
$::main_status update $update_index_cp $total_cnt
123123
}
124124

125-
proc update_index {msg pathList after} {
125+
proc update_index {msg path_list after} {
126126
global update_index_cp
127127

128128
if {![lock_index update]} return
129129

130130
set update_index_cp 0
131-
set pathList [lsort $pathList]
132-
set totalCnt [llength $pathList]
133-
set batch [expr {int($totalCnt * .01) + 1}]
131+
set path_list [lsort $path_list]
132+
set total_cnt [llength $path_list]
133+
set batch [expr {int($total_cnt * .01) + 1}]
134134
if {$batch > 25} {set batch 25}
135135

136136
$::main_status start $msg [mc "files"]
@@ -144,26 +144,26 @@ proc update_index {msg pathList after} {
144144
fileevent $fd writable [list \
145145
write_update_index \
146146
$fd \
147-
$pathList \
148-
$totalCnt \
147+
$path_list \
148+
$total_cnt \
149149
$batch \
150150
$after \
151151
]
152152
}
153153

154-
proc write_update_index {fd pathList totalCnt batch after} {
154+
proc write_update_index {fd path_list total_cnt batch after} {
155155
global update_index_cp
156156
global file_states current_diff_path
157157

158-
if {$update_index_cp >= $totalCnt} {
158+
if {$update_index_cp >= $total_cnt} {
159159
_close_updateindex $fd $after
160160
return
161161
}
162162

163163
for {set i $batch} \
164-
{$update_index_cp < $totalCnt && $i > 0} \
164+
{$update_index_cp < $total_cnt && $i > 0} \
165165
{incr i -1} {
166-
set path [lindex $pathList $update_index_cp]
166+
set path [lindex $path_list $update_index_cp]
167167
incr update_index_cp
168168

169169
switch -glob -- [lindex $file_states($path) 0] {
@@ -190,18 +190,18 @@ proc write_update_index {fd pathList totalCnt batch after} {
190190
display_file $path $new
191191
}
192192

193-
$::main_status update $update_index_cp $totalCnt
193+
$::main_status update $update_index_cp $total_cnt
194194
}
195195

196-
proc checkout_index {msg pathList after} {
196+
proc checkout_index {msg path_list after} {
197197
global update_index_cp
198198

199199
if {![lock_index update]} return
200200

201201
set update_index_cp 0
202-
set pathList [lsort $pathList]
203-
set totalCnt [llength $pathList]
204-
set batch [expr {int($totalCnt * .01) + 1}]
202+
set path_list [lsort $path_list]
203+
set total_cnt [llength $path_list]
204+
set batch [expr {int($total_cnt * .01) + 1}]
205205
if {$batch > 25} {set batch 25}
206206

207207
$::main_status start $msg [mc "files"]
@@ -221,26 +221,26 @@ proc checkout_index {msg pathList after} {
221221
fileevent $fd writable [list \
222222
write_checkout_index \
223223
$fd \
224-
$pathList \
225-
$totalCnt \
224+
$path_list \
225+
$total_cnt \
226226
$batch \
227227
$after \
228228
]
229229
}
230230

231-
proc write_checkout_index {fd pathList totalCnt batch after} {
231+
proc write_checkout_index {fd path_list total_cnt batch after} {
232232
global update_index_cp
233233
global file_states current_diff_path
234234

235-
if {$update_index_cp >= $totalCnt} {
235+
if {$update_index_cp >= $total_cnt} {
236236
_close_updateindex $fd $after
237237
return
238238
}
239239

240240
for {set i $batch} \
241-
{$update_index_cp < $totalCnt && $i > 0} \
241+
{$update_index_cp < $total_cnt && $i > 0} \
242242
{incr i -1} {
243-
set path [lindex $pathList $update_index_cp]
243+
set path [lindex $path_list $update_index_cp]
244244
incr update_index_cp
245245
switch -glob -- [lindex $file_states($path) 0] {
246246
U? {continue}
@@ -253,35 +253,35 @@ proc write_checkout_index {fd pathList totalCnt batch after} {
253253
}
254254
}
255255

256-
$::main_status update $update_index_cp $totalCnt
256+
$::main_status update $update_index_cp $total_cnt
257257
}
258258

259259
proc unstage_helper {txt paths} {
260260
global file_states current_diff_path
261261

262262
if {![lock_index begin-update]} return
263263

264-
set pathList [list]
264+
set path_list [list]
265265
set after {}
266266
foreach path $paths {
267267
switch -glob -- [lindex $file_states($path) 0] {
268268
A? -
269269
M? -
270270
T? -
271271
D? {
272-
lappend pathList $path
272+
lappend path_list $path
273273
if {$path eq $current_diff_path} {
274274
set after {reshow_diff;}
275275
}
276276
}
277277
}
278278
}
279-
if {$pathList eq {}} {
279+
if {$path_list eq {}} {
280280
unlock_index
281281
} else {
282282
update_indexinfo \
283283
$txt \
284-
$pathList \
284+
$path_list \
285285
[concat $after [list ui_ready]]
286286
}
287287
}
@@ -305,7 +305,7 @@ proc add_helper {txt paths} {
305305

306306
if {![lock_index begin-update]} return
307307

308-
set pathList [list]
308+
set path_list [list]
309309
set after {}
310310
foreach path $paths {
311311
switch -glob -- [lindex $file_states($path) 0] {
@@ -321,19 +321,19 @@ proc add_helper {txt paths} {
321321
?M -
322322
?D -
323323
?T {
324-
lappend pathList $path
324+
lappend path_list $path
325325
if {$path eq $current_diff_path} {
326326
set after {reshow_diff;}
327327
}
328328
}
329329
}
330330
}
331-
if {$pathList eq {}} {
331+
if {$path_list eq {}} {
332332
unlock_index
333333
} else {
334334
update_index \
335335
$txt \
336-
$pathList \
336+
$path_list \
337337
[concat $after {ui_status [mc "Ready to commit."]}]
338338
}
339339
}
@@ -393,15 +393,15 @@ proc revert_helper {txt paths} {
393393

394394
if {![lock_index begin-update]} return
395395

396-
set pathList [list]
396+
set path_list [list]
397397
set after {}
398398
foreach path $paths {
399399
switch -glob -- [lindex $file_states($path) 0] {
400400
U? {continue}
401401
?M -
402402
?T -
403403
?D {
404-
lappend pathList $path
404+
lappend path_list $path
405405
if {$path eq $current_diff_path} {
406406
set after {reshow_diff;}
407407
}
@@ -420,12 +420,12 @@ proc revert_helper {txt paths} {
420420
# as they have quite complex plural-form rules. Unfortunately,
421421
# msgcat doesn't seem to support that kind of string translation.
422422
#
423-
set n [llength $pathList]
423+
set n [llength $path_list]
424424
if {$n == 0} {
425425
unlock_index
426426
return
427427
} elseif {$n == 1} {
428-
set query [mc "Revert changes in file %s?" [short_path [lindex $pathList]]]
428+
set query [mc "Revert changes in file %s?" [short_path [lindex $path_list]]]
429429
} else {
430430
set query [mc "Revert changes in these %i files?" $n]
431431
}
@@ -444,7 +444,7 @@ proc revert_helper {txt paths} {
444444
if {$reply == 1} {
445445
checkout_index \
446446
$txt \
447-
$pathList \
447+
$path_list \
448448
[concat $after [list ui_ready]]
449449
} else {
450450
unlock_index

0 commit comments

Comments
 (0)