Skip to content

new architecture: keep track of added/reset files #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Laoujin opened this issue Dec 29, 2018 · 0 comments
Open

new architecture: keep track of added/reset files #2

Laoujin opened this issue Dec 29, 2018 · 0 comments
Labels
epic Probably requires a lot of work

Comments

@Laoujin
Copy link
Member

Laoujin commented Dec 29, 2018

  • no config.workingDir & config.stagingArea: put in one list.

object looks like: @{state=$_[0];file=$file;staged=$true}
need to add ;working=$false

Use number indexes for workingDir and alphabet for stagingArea?

all Git-functions should define a config about what they are supposed to do
and be updated on checkout/add/...

$filter = ({
	param($fileInfo)
	$fileInfo.state -ne 'D'
})
$config = @{
	gitCommand="git add";
	staging=$false;
	working=$true;
	defaultToAllFiles=$true;
	extraFileFilterFn=$filter; # only Git-NumberedDiff needs this atm. is this necessary?
}


function Execute-GitConfig($config, $fileInfo) {
	if ($args.length -eq 0 -or $args[0] -eq $null) {
		$args = @("0-$($global:gitStatusNumbers.stagingArea.length - 1)")
	}

	$fileInfos = Parse-GitIndexes $args 'stagingArea'
	if (-not $fileInfos) {
		return
	}

	$files = $fileInfos | % {$_.file}
	Invoke-Git diff --cached $files
}
  • Git-NumberedDiff: Should also work for already staged files
  • Git-NumberedReset: Should also work for not staged files that are then Git-NumberedAdded
  • Git-NumberedAdd/Diff should allow args like -p / --word-diff: ga -p / gdc / gdw / gdcw ?
  • Keep track of added/reset files and use diff --cached to keep gd working
  • Staged file can be added again after a grs
@Laoujin Laoujin changed the title Keep track of added/reset files new architecture: keep track of added/reset files Dec 30, 2018
@Laoujin Laoujin added the epic Probably requires a lot of work label Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Probably requires a lot of work
Projects
None yet
Development

No branches or pull requests

1 participant