git print better

This commit is contained in:
2025-02-19 07:15:14 +03:00
parent 49af31776e
commit cdaf64b3cf
2 changed files with 8 additions and 1 deletions

View File

@@ -32,7 +32,7 @@ fn format_repo_info(repo GitRepo) ![]string {
'[${repo.status_local.branch}]' // Otherwise, display branch
}
relative_path := repo.get_relative_path()!
relative_path := repo.get_human_path()!
return [' - ${relative_path}', tag_or_branch, status]
}

View File

@@ -71,6 +71,13 @@ pub fn (repo GitRepo) get_relative_path() !string {
return mypath.path_relative(repo_.gs.coderoot.path) or { panic("couldn't get relative path") }
}
//path where we use ~ and its the full path
pub fn (repo GitRepo) get_human_path() !string {
mut mypath := repo.patho()!.path.replace(os.home_dir(),"~")
return mypath
}
pub fn (mut repo GitRepo) get_parent_dir(args GetParentDir) !string {
repo_path := repo.path()
parent_dir := os.dir(repo_path)