From: "Jonathan Gilbert via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Jonathan Gilbert <rcq8n2xf3v@liamekaens.com>,
Pratyush Yadav <me@yadavpratyush.com>,
Jonathan Gilbert <JonathanG@iQmetrix.com>
Subject: [PATCH v6 1/3] git-gui: consolidate naming conventions
Date: Thu, 28 Nov 2019 08:30:31 +0000 [thread overview]
Message-ID: <da1704c56e0bd3f1ac53af96b702e3777bb3eb37.1574929833.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.436.v6.git.1574929833.gitgitgadget@gmail.com>
From: Jonathan Gilbert <JonathanG@iQmetrix.com>
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 <JonathanG@iQmetrix.com>
---
lib/index.tcl | 92 +++++++++++++++++++++++++--------------------------
1 file changed, 46 insertions(+), 46 deletions(-)
diff --git a/lib/index.tcl b/lib/index.tcl
index e07b7a3762..28d4d2a54e 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -56,15 +56,15 @@ proc _close_updateindex {fd after} {
uplevel #0 $after
}
-proc update_indexinfo {msg pathList after} {
+proc update_indexinfo {msg path_list after} {
global update_index_cp
if {![lock_index update]} return
set update_index_cp 0
- set pathList [lsort $pathList]
- set totalCnt [llength $pathList]
- set batch [expr {int($totalCnt * .01) + 1}]
+ set path_list [lsort $path_list]
+ set total_cnt [llength $path_list]
+ set batch [expr {int($total_cnt * .01) + 1}]
if {$batch > 25} {set batch 25}
$::main_status start $msg [mc "files"]
@@ -78,26 +78,26 @@ proc update_indexinfo {msg pathList after} {
fileevent $fd writable [list \
write_update_indexinfo \
$fd \
- $pathList \
- $totalCnt \
+ $path_list \
+ $total_cnt \
$batch \
$after \
]
}
-proc write_update_indexinfo {fd pathList totalCnt batch after} {
+proc write_update_indexinfo {fd path_list total_cnt batch after} {
global update_index_cp
global file_states current_diff_path
- if {$update_index_cp >= $totalCnt} {
+ if {$update_index_cp >= $total_cnt} {
_close_updateindex $fd $after
return
}
for {set i $batch} \
- {$update_index_cp < $totalCnt && $i > 0} \
+ {$update_index_cp < $total_cnt && $i > 0} \
{incr i -1} {
- set path [lindex $pathList $update_index_cp]
+ set path [lindex $path_list $update_index_cp]
incr update_index_cp
set s $file_states($path)
@@ -119,18 +119,18 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} {
display_file $path $new
}
- $::main_status update $update_index_cp $totalCnt
+ $::main_status update $update_index_cp $total_cnt
}
-proc update_index {msg pathList after} {
+proc update_index {msg path_list after} {
global update_index_cp
if {![lock_index update]} return
set update_index_cp 0
- set pathList [lsort $pathList]
- set totalCnt [llength $pathList]
- set batch [expr {int($totalCnt * .01) + 1}]
+ set path_list [lsort $path_list]
+ set total_cnt [llength $path_list]
+ set batch [expr {int($total_cnt * .01) + 1}]
if {$batch > 25} {set batch 25}
$::main_status start $msg [mc "files"]
@@ -144,26 +144,26 @@ proc update_index {msg pathList after} {
fileevent $fd writable [list \
write_update_index \
$fd \
- $pathList \
- $totalCnt \
+ $path_list \
+ $total_cnt \
$batch \
$after \
]
}
-proc write_update_index {fd pathList totalCnt batch after} {
+proc write_update_index {fd path_list total_cnt batch after} {
global update_index_cp
global file_states current_diff_path
- if {$update_index_cp >= $totalCnt} {
+ if {$update_index_cp >= $total_cnt} {
_close_updateindex $fd $after
return
}
for {set i $batch} \
- {$update_index_cp < $totalCnt && $i > 0} \
+ {$update_index_cp < $total_cnt && $i > 0} \
{incr i -1} {
- set path [lindex $pathList $update_index_cp]
+ set path [lindex $path_list $update_index_cp]
incr update_index_cp
switch -glob -- [lindex $file_states($path) 0] {
@@ -190,18 +190,18 @@ proc write_update_index {fd pathList totalCnt batch after} {
display_file $path $new
}
- $::main_status update $update_index_cp $totalCnt
+ $::main_status update $update_index_cp $total_cnt
}
-proc checkout_index {msg pathList after} {
+proc checkout_index {msg path_list after} {
global update_index_cp
if {![lock_index update]} return
set update_index_cp 0
- set pathList [lsort $pathList]
- set totalCnt [llength $pathList]
- set batch [expr {int($totalCnt * .01) + 1}]
+ set path_list [lsort $path_list]
+ set total_cnt [llength $path_list]
+ set batch [expr {int($total_cnt * .01) + 1}]
if {$batch > 25} {set batch 25}
$::main_status start $msg [mc "files"]
@@ -221,26 +221,26 @@ proc checkout_index {msg pathList after} {
fileevent $fd writable [list \
write_checkout_index \
$fd \
- $pathList \
- $totalCnt \
+ $path_list \
+ $total_cnt \
$batch \
$after \
]
}
-proc write_checkout_index {fd pathList totalCnt batch after} {
+proc write_checkout_index {fd path_list total_cnt batch after} {
global update_index_cp
global file_states current_diff_path
- if {$update_index_cp >= $totalCnt} {
+ if {$update_index_cp >= $total_cnt} {
_close_updateindex $fd $after
return
}
for {set i $batch} \
- {$update_index_cp < $totalCnt && $i > 0} \
+ {$update_index_cp < $total_cnt && $i > 0} \
{incr i -1} {
- set path [lindex $pathList $update_index_cp]
+ set path [lindex $path_list $update_index_cp]
incr update_index_cp
switch -glob -- [lindex $file_states($path) 0] {
U? {continue}
@@ -253,7 +253,7 @@ proc write_checkout_index {fd pathList totalCnt batch after} {
}
}
- $::main_status update $update_index_cp $totalCnt
+ $::main_status update $update_index_cp $total_cnt
}
proc unstage_helper {txt paths} {
@@ -261,7 +261,7 @@ proc unstage_helper {txt paths} {
if {![lock_index begin-update]} return
- set pathList [list]
+ set path_list [list]
set after {}
foreach path $paths {
switch -glob -- [lindex $file_states($path) 0] {
@@ -269,19 +269,19 @@ proc unstage_helper {txt paths} {
M? -
T? -
D? {
- lappend pathList $path
+ lappend path_list $path
if {$path eq $current_diff_path} {
set after {reshow_diff;}
}
}
}
}
- if {$pathList eq {}} {
+ if {$path_list eq {}} {
unlock_index
} else {
update_indexinfo \
$txt \
- $pathList \
+ $path_list \
[concat $after [list ui_ready]]
}
}
@@ -305,7 +305,7 @@ proc add_helper {txt paths} {
if {![lock_index begin-update]} return
- set pathList [list]
+ set path_list [list]
set after {}
foreach path $paths {
switch -glob -- [lindex $file_states($path) 0] {
@@ -321,19 +321,19 @@ proc add_helper {txt paths} {
?M -
?D -
?T {
- lappend pathList $path
+ lappend path_list $path
if {$path eq $current_diff_path} {
set after {reshow_diff;}
}
}
}
}
- if {$pathList eq {}} {
+ if {$path_list eq {}} {
unlock_index
} else {
update_index \
$txt \
- $pathList \
+ $path_list \
[concat $after {ui_status [mc "Ready to commit."]}]
}
}
@@ -393,7 +393,7 @@ proc revert_helper {txt paths} {
if {![lock_index begin-update]} return
- set pathList [list]
+ set path_list [list]
set after {}
foreach path $paths {
switch -glob -- [lindex $file_states($path) 0] {
@@ -401,7 +401,7 @@ proc revert_helper {txt paths} {
?M -
?T -
?D {
- lappend pathList $path
+ lappend path_list $path
if {$path eq $current_diff_path} {
set after {reshow_diff;}
}
@@ -420,12 +420,12 @@ proc revert_helper {txt paths} {
# as they have quite complex plural-form rules. Unfortunately,
# msgcat doesn't seem to support that kind of string translation.
#
- set n [llength $pathList]
+ set n [llength $path_list]
if {$n == 0} {
unlock_index
return
} elseif {$n == 1} {
- set query [mc "Revert changes in file %s?" [short_path [lindex $pathList]]]
+ set query [mc "Revert changes in file %s?" [short_path [lindex $path_list]]]
} else {
set query [mc "Revert changes in these %i files?" $n]
}
@@ -444,7 +444,7 @@ proc revert_helper {txt paths} {
if {$reply == 1} {
checkout_index \
$txt \
- $pathList \
+ $path_list \
[concat $after [list ui_ready]]
} else {
unlock_index
--
gitgitgadget
next prev parent reply other threads:[~2019-11-28 8:30 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 6:48 [PATCH 0/2] git-gui: revert untracked files by deleting them Jonathan Gilbert via GitGitGadget
2019-10-30 6:48 ` [PATCH 1/2] git-gui: consolidate naming conventions Jonathan Gilbert via GitGitGadget
2019-11-03 0:27 ` Pratyush Yadav
2019-10-30 6:48 ` [PATCH 2/2] git-gui: revert untracked files by deleting them Jonathan Gilbert via GitGitGadget
2019-11-03 7:44 ` Pratyush Yadav
2019-11-04 16:04 ` Jonathan Gilbert
2019-11-04 17:36 ` Jonathan Gilbert
2019-10-30 9:06 ` [PATCH 0/2] " Bert Wesarg
2019-10-30 17:16 ` Jonathan Gilbert
2019-11-03 1:12 ` Pratyush Yadav
2019-11-03 4:41 ` Jonathan Gilbert
2019-11-03 7:54 ` Pratyush Yadav
2019-11-07 7:05 ` [PATCH v2 " Jonathan Gilbert via GitGitGadget
2019-11-07 7:05 ` [PATCH v2 1/2] git-gui: consolidate naming conventions Jonathan Gilbert via GitGitGadget
2019-11-07 7:05 ` [PATCH v2 2/2] git-gui: revert untracked files by deleting them Jonathan Gilbert via GitGitGadget
2019-11-11 19:25 ` Pratyush Yadav
2019-11-11 21:55 ` Jonathan Gilbert
2019-11-11 22:59 ` Philip Oakley
2019-11-12 4:49 ` Jonathan Gilbert
2019-11-12 10:45 ` Philip Oakley
2019-11-12 16:29 ` Jonathan Gilbert
2019-11-26 11:22 ` Philip Oakley
2019-11-12 19:35 ` Pratyush Yadav
2019-11-11 19:35 ` [PATCH v2 0/2] " Pratyush Yadav
2019-11-13 9:56 ` [PATCH v3 " Jonathan Gilbert via GitGitGadget
2019-11-13 9:56 ` [PATCH v3 1/2] git-gui: consolidate naming conventions Jonathan Gilbert via GitGitGadget
2019-11-13 9:56 ` [PATCH v3 2/2] git-gui: revert untracked files by deleting them Jonathan Gilbert via GitGitGadget
2019-11-16 15:11 ` Pratyush Yadav
2019-11-16 21:42 ` Jonathan Gilbert
2019-11-17 6:56 ` [PATCH v4 0/2] " Jonathan Gilbert via GitGitGadget
2019-11-17 6:56 ` [PATCH v4 1/2] git-gui: consolidate naming conventions Jonathan Gilbert via GitGitGadget
2019-11-17 6:56 ` [PATCH v4 2/2] git-gui: revert untracked files by deleting them Jonathan Gilbert via GitGitGadget
2019-11-24 13:09 ` Pratyush Yadav
2019-11-19 15:21 ` [PATCH v4 0/2] " Pratyush Yadav
2019-11-19 16:56 ` Jonathan Gilbert
2019-11-24 20:37 ` [PATCH v5 0/3] " Jonathan Gilbert via GitGitGadget
2019-11-24 20:37 ` [PATCH v5 1/3] git-gui: consolidate naming conventions Jonathan Gilbert via GitGitGadget
2019-11-24 20:37 ` [PATCH v5 2/3] git-gui: update status bar to track operations Jonathan Gilbert via GitGitGadget
2019-11-27 21:55 ` Pratyush Yadav
2019-11-28 7:34 ` Jonathan Gilbert
2019-11-24 20:37 ` [PATCH v5 3/3] git-gui: revert untracked files by deleting them Jonathan Gilbert via GitGitGadget
2019-11-27 22:03 ` Pratyush Yadav
2019-11-28 8:30 ` [PATCH v6 0/3] " Jonathan Gilbert via GitGitGadget
2019-11-28 8:30 ` Jonathan Gilbert via GitGitGadget [this message]
2019-11-28 8:30 ` [PATCH v6 2/3] git-gui: update status bar to track operations Jonathan Gilbert via GitGitGadget
2019-11-30 23:05 ` Pratyush Yadav
2019-12-01 2:12 ` Jonathan Gilbert
2019-12-01 11:43 ` Philip Oakley
2019-12-01 20:09 ` Jonathan Gilbert
2019-11-28 8:30 ` [PATCH v6 3/3] git-gui: revert untracked files by deleting them Jonathan Gilbert via GitGitGadget
2019-12-01 2:28 ` [PATCH v7 0/3] " Jonathan Gilbert via GitGitGadget
2019-12-01 2:28 ` [PATCH v7 1/3] git-gui: consolidate naming conventions Jonathan Gilbert via GitGitGadget
2019-12-01 2:28 ` [PATCH v7 2/3] git-gui: update status bar to track operations Jonathan Gilbert via GitGitGadget
2020-02-26 8:24 ` Benjamin Poirier
2020-03-02 18:14 ` Pratyush Yadav
2019-12-01 2:28 ` [PATCH v7 3/3] git-gui: revert untracked files by deleting them Jonathan Gilbert via GitGitGadget
2019-12-05 18:54 ` [PATCH v7 0/3] " Pratyush Yadav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=da1704c56e0bd3f1ac53af96b702e3777bb3eb37.1574929833.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=JonathanG@iQmetrix.com \
--cc=git@vger.kernel.org \
--cc=me@yadavpratyush.com \
--cc=rcq8n2xf3v@liamekaens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).