Skip to content

Commit 0457470

Browse files
authored
Merge pull request #43 from shadear-bakr/master
refactor: remove unnecessary repainting jobs
2 parents a2e5259 + 64df379 commit 0457470

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

conf.d/gitnow.fish

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ function gitnow -d "Gitnow: Speed up your Git workflow. 🐠" -a xversion
1515
echo "GitNow version $gitnow_version"
1616
else
1717
__gitnow_manual | command less -r
18-
commandline -f repaint
1918
end
2019
end
2120

@@ -26,7 +25,6 @@ function state -d "Gitnow: Show the working tree status in compact way"
2625
end
2726

2827
command git status -sb
29-
commandline -f repaint
3028
end
3129

3230
function stage -d "Gitnow: Stage files in current working directory"
@@ -43,7 +41,6 @@ function stage -d "Gitnow: Stage files in current working directory"
4341
end
4442

4543
command git add $opts
46-
commandline -f repaint
4744
end
4845

4946
function unstage -d "Gitnow: Unstage files in current working directory"
@@ -60,7 +57,6 @@ function unstage -d "Gitnow: Unstage files in current working directory"
6057
end
6158

6259
command git reset $opts
63-
commandline -f repaint
6460
end
6561

6662
function show -d "Gitnow: Show commit detail objects"
@@ -77,7 +73,6 @@ function show -d "Gitnow: Show commit detail objects"
7773
command git show --compact-summary --patch HEAD
7874
end
7975

80-
commandline -f repaint
8176
end
8277

8378
function untracked -d "Gitnow: Check for untracked files and directories on current working directory"
@@ -88,7 +83,6 @@ function untracked -d "Gitnow: Check for untracked files and directories on curr
8883

8984
command git clean --dry-run -d
9085

91-
commandline -f repaint
9286
end
9387

9488
function commit -d "Gitnow: Commit changes to the repository"
@@ -105,7 +99,6 @@ function commit -d "Gitnow: Commit changes to the repository"
10599
command git commit
106100
end
107101

108-
commandline -f repaint
109102
end
110103

111104
function commit-all -d "Gitnow: Add and commit all changes to the repository"
@@ -161,7 +154,6 @@ function pull -d "Gitnow: Pull changes from remote server but stashing uncommitt
161154
end
162155

163156
command git pull $xcmd $xdefaults
164-
commandline -f repaint
165157
end
166158

167159
# Git push with --set-upstream
@@ -216,7 +208,6 @@ function push -d "Gitnow: Push commit changes to remote repository"
216208
echo
217209

218210
command git push --set-upstream $opts
219-
commandline -f repaint
220211
end
221212

222213
function upstream -d "Gitnow: Commit all changes and push them to remote server"
@@ -236,7 +227,6 @@ function feature -d "GitNow: Creates a new Gitflow feature branch from current b
236227
end
237228

238229
__gitnow_gitflow_branch "feature" $xbranch
239-
commandline -f repaint
240230
end
241231

242232
function hotfix -d "GitNow: Creates a new Gitflow hotfix branch from current branch" -a xbranch
@@ -246,7 +236,6 @@ function hotfix -d "GitNow: Creates a new Gitflow hotfix branch from current bra
246236
end
247237

248238
__gitnow_gitflow_branch "hotfix" $xbranch
249-
commandline -f repaint
250239
end
251240

252241
function bugfix -d "GitNow: Creates a new Gitflow bugfix branch from current branch" -a xbranch
@@ -256,7 +245,6 @@ function bugfix -d "GitNow: Creates a new Gitflow bugfix branch from current bra
256245
end
257246

258247
__gitnow_gitflow_branch "bugfix" $xbranch
259-
commandline -f repaint
260248
end
261249

262250
function release -d "GitNow: Creates a new Gitflow release branch from current branch" -a xbranch
@@ -266,7 +254,6 @@ function release -d "GitNow: Creates a new Gitflow release branch from current b
266254
end
267255

268256
__gitnow_gitflow_branch "release" $xbranch
269-
commandline -f repaint
270257
end
271258

272259
function merge -d "GitNow: Merges given branch into the active one"
@@ -311,22 +298,19 @@ function merge -d "GitNow: Merges given branch into the active one"
311298
if test "$v_abort";
312299
echo "Abort the current merge"
313300
command git merge --abort
314-
commandline -f repaint
315301
return
316302
end
317303

318304
# continue
319305
if test "$v_continue";
320306
echo "Continue the current merge"
321307
command git merge --continue
322-
commandline -f repaint
323308
return
324309
end
325310

326311
# No branch defined
327312
if not test -n "$v_branch"
328313
echo "Provide a valid branch name to merge."
329-
commandline -f repaint
330314
return
331315
end
332316

@@ -336,19 +320,16 @@ function merge -d "GitNow: Merges given branch into the active one"
336320
if test $v_found -eq 0;
337321
echo "Local branch `$v_branch` was not found. Not possible to merge."
338322

339-
commandline -f repaint
340323
return
341324
end
342325

343326
# Detect merging current branch
344327
if [ "$v_branch" = (__gitnow_current_branch_name) ]
345328
echo "Branch `$v_branch` is the same as current branch. Nothing to do."
346-
commandline -f repaint
347329
return
348330
end
349331

350332
command git merge $v_branch
351-
commandline -f repaint
352333
end
353334

354335
function move -d "GitNow: Switch from current branch to another but stashing uncommitted changes"
@@ -390,7 +371,6 @@ function move -d "GitNow: Switch from current branch to another but stashing unc
390371
if not test -n "$v_branch"
391372
echo "Provide a valid branch name to switch to."
392373

393-
commandline -f repaint
394374
return
395375
end
396376

@@ -401,7 +381,6 @@ function move -d "GitNow: Switch from current branch to another but stashing unc
401381
set -l v_remote (__gitnow_current_remote)
402382
command git fetch $v_remote $v_branch:refs/remotes/$v_remote/$v_branch
403383
command git checkout --track $v_remote/$v_branch
404-
commandline -f repaint
405384
return
406385
end
407386

@@ -412,14 +391,12 @@ function move -d "GitNow: Switch from current branch to another but stashing unc
412391
echo "Branch `$v_branch` was not found locally. No possible to switch."
413392
echo "Tip: Use -u (--upstream) flag to fetch a remote branch."
414393

415-
commandline -f repaint
416394
return
417395
end
418396

419397
# Prevent same branch switching
420398
if [ "$v_branch" = (__gitnow_current_branch_name) ]
421399
echo "Branch `$v_branch` is the same as current branch. Nothing to do."
422-
commandline -f repaint
423400
return
424401
end
425402

@@ -442,7 +419,6 @@ function move -d "GitNow: Switch from current branch to another but stashing unc
442419
echo "Stashed changes applied."
443420
end
444421

445-
commandline -f repaint
446422
end
447423

448424
function logs -d "Gitnow: Shows logs in a fancy way"
@@ -659,7 +635,6 @@ function tag -d "Gitnow: Tag commits following Semver"
659635
# TODO: Prepatch version tags
660636

661637

662-
commandline -f repaint
663638
end
664639

665640
function assume -d "Gitnow: Ignore files temporarily"
@@ -700,12 +675,10 @@ function github -d "Gitnow: Clone a GitHub repository using SSH"
700675
set -l repo (__gitnow_clone_params $argv)
701676
__gitnow_clone_repo $repo "github"
702677

703-
commandline -f repaint
704678
end
705679

706680
function bitbucket -d "Gitnow: Clone a Bitbucket Cloud repository using SSH"
707681
set -l repo (__gitnow_clone_params $argv)
708682
__gitnow_clone_repo $repo "bitbucket"
709683

710-
commandline -f repaint
711684
end

functions/__gitnow_config_file.fish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function __gitnow_read_config -d "Reads the GitNow config file"
127127
# If command key is not valid then just skip out
128128
if test $v_valid -eq 0; continue; end
129129

130-
set cmd (echo -n "bind \\$v_command_val \"echo; if $v_command_key; commandline -f repaint; else ; end\"")
130+
set cmd (echo -n "bind \\$v_command_val \"echo; $v_command_key; commandline -f repaint;\"")
131131
end
132132

133133
eval $cmd

0 commit comments

Comments
 (0)