Adds git helper functions for viewing tracked,untracked,staged,unstaged files
This commit is contained in:
		
							parent
							
								
									f40a345766
								
							
						
					
					
						commit
						560121a87b
					
				
					 1 changed files with 16 additions and 4 deletions
				
			
		| 
						 | 
					@ -7,13 +7,25 @@ function wgbranch {
 | 
				
			||||||
# Outputs staged, unstaged, untracked files
 | 
					# Outputs staged, unstaged, untracked files
 | 
				
			||||||
# Similar to `git status` output but without the cruft
 | 
					# Similar to `git status` output but without the cruft
 | 
				
			||||||
function wg-git-changed-files {
 | 
					function wg-git-changed-files {
 | 
				
			||||||
    tracked_staged=$(git diff --name-only --staged)
 | 
					  tracked_staged=$(wg-diff-tracked-staged)
 | 
				
			||||||
    tracked_unstaged=$(git diff --name-only)
 | 
					  tracked_unstaged=$(wg-diff-tracked-unstaged)
 | 
				
			||||||
    untracked_unstaged=$(git ls-files --others --exclude-standard)
 | 
					  untracked_unstaged=$(wg-diff-untracked-unstaged)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  echo "${tracked_staged}\n${tracked_unstaged}\n${untracked_unstaged}"
 | 
					  echo "${tracked_staged}\n${tracked_unstaged}\n${untracked_unstaged}"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function wg-diff-tracked-staged {
 | 
				
			||||||
 | 
					  git --no-pager diff --name-only --staged
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function wg-diff-tracked-unstaged {
 | 
				
			||||||
 | 
					  git --no-pager diff --name-only
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function wg-diff-untracked-unstaged {
 | 
				
			||||||
 | 
					  git ls-files --others --exclude-standard
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# git status "plumbing" version
 | 
					# git status "plumbing" version
 | 
				
			||||||
# Useful for piping into grep -> xargs git add
 | 
					# Useful for piping into grep -> xargs git add
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue