-
Notifications
You must be signed in to change notification settings - Fork 66
Add :prune=trivial-merge filter #1483
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
Draft
christian-schilling
wants to merge
1
commit into
master
Choose a base branch
from
@changes/master/[email protected]/prune-trivial-merges
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,22 @@ fn make_op(args: &[&str]) -> JoshResult<Op> { | |
["SQUASH"] => Ok(Op::Squash(None)), | ||
["SQUASH", _ids @ ..] => Err(josh_error("SQUASH with ids can't be parsed")), | ||
["linear"] => Ok(Op::Linear), | ||
["prune", "trivial-merge"] => Ok(Op::Prune), | ||
["prune"] => Err(josh_error(indoc!( | ||
r#" | ||
Filter ":prune" requires an argument. | ||
|
||
Note: use "=" to provide the argument value: | ||
|
||
:prune=trivial-merge | ||
"# | ||
))), | ||
["prune", _] => Err(josh_error(indoc!( | ||
r#" | ||
Filter ":prune" only supports "trivial-merge" | ||
as arguement value. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. argument |
||
"# | ||
))), | ||
["unsign"] => Ok(Op::Unsign), | ||
["PATHS"] => Ok(Op::Paths), | ||
["INDEX"] => Ok(Op::Index), | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
$ export RUST_BACKTRACE=1 | ||
$ git init -q 1> /dev/null | ||
|
||
$ echo contents1 > file1 | ||
$ git add . | ||
$ git commit -m "add file1" 1> /dev/null | ||
|
||
$ git log --graph --pretty=%s | ||
* add file1 | ||
|
||
$ git checkout -b branch1 | ||
Switched to a new branch 'branch1' | ||
$ echo contents2 > file2 | ||
$ git add . | ||
$ git commit -m "add file2" 1> /dev/null | ||
|
||
$ git checkout master | ||
Switched to branch 'master' | ||
|
||
$ echo contents3 > file1 | ||
$ git add . | ||
$ git commit -m "mod file1" 1> /dev/null | ||
|
||
$ git merge -q branch1 --no-ff | ||
$ git log --graph --pretty=%s | ||
* Merge branch 'branch1' | ||
|\ | ||
| * add file2 | ||
* | mod file1 | ||
|/ | ||
* add file1 | ||
|
||
$ josh-filter -s ::file1 | ||
[3] ::file1 | ||
$ git log --graph --pretty=%s FILTERED_HEAD | ||
* Merge branch 'branch1' | ||
|\ | ||
* | mod file1 | ||
|/ | ||
* add file1 | ||
$ josh-filter -s ::file1:prune=trivial-merge | ||
[2] :prune=trivial-merge | ||
[3] ::file1 | ||
|
||
$ git log --graph --pretty=%s FILTERED_HEAD | ||
* mod file1 | ||
* add file1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.