Skip to content

Some arguably useful scripts made or modified by me

License

Notifications You must be signed in to change notification settings

mihail-8480/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mihail's Scripts

Some arguably useful scripts made or modified by me.

.NET Scripts

The .NET scripts have their own README in the dotnet directory.

Perf Scripts

The perf scripts have their own README in the perf directory.

Track Script

A persistent stopwatch.

Start

To start a stopwatch use:

track start <name>

Stop

To stop the stopwatch use:

track stop <name>

The total time measured by the stopwatch is returned (in seconds).

Current Time

To get the current time (amount passed since last start) use:

track current <name>

Total Time

To get the total time (amount passed since first start) use:

track total <name>

View All

To view all stopwatches use (set NO_TABLE to disable table generation):

track

Delete

To delete a stopwatch use:

track end <name>

Environment Variables

  • TRACKER_DIRECTORY - The path where the files created by this script should get stored at (defaults to $HOME/.local/share/time).
  • NO_TABLE - If this variable is set to any non-empty value the script won't generate tables or format text.

Git Utilities

Git helper functions.

find_repo_root

Outputs the path of the current repository.

Tip

This function also has an alias called find-repo-root.

source "git-utils.sh"

REPO_PATH=$(find_repo_root)

check_branch

Check if the current branch is equal to some value, exits if it's not.

source "git-utils.sh"

check_branch <branch>

check_clean

Checks if the local repo has changes that need to be pushed to the remote repo, exits if there are any changes.

source "git-utils.sh"

check_clean

sync_branches

Syncs $2 with $1 by checking out to $2 and rebasing from $1, then rebasing $1 from $2 while pushing changes to remote.

source "git-utils.sh"

sync_branches <branch1> <branch2>

Warning

This function does push --force-with-lease on $1 when rebasing from $2 in the second part of the sync process. This step is unnecessary and doesn't do anything when $1 is ahead of $2 before the sync. If there are actual conflicts the sync_branches command should fail at the first rebase.

update_submodules

Updates the submodules of the current repository.

Tip

This function has a command script called update-submodules.

source "git-utils.sh"

update_submodules

About

Some arguably useful scripts made or modified by me

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages