What is the proper way to stage / unstage specific lines in a diff? [message #1853155] |
Tue, 21 June 2022 01:39 |
Cody Mikol Messages: 5 Registered: December 2021 |
Junior Member |
|
|
Hello,
Is there a way in Jgit to take a diff like so
--- a/src/test/kotlin/state/GitDownStateSpec.kt
+++ b/src/test/kotlin/state/GitDownStateSpec.kt
@@ -16,8 +16,9 @@
val git: Git,
) {
+
fun addFile(filename: String, content: String) = this.also {
- val path = this.dir.toString() + "/" + filename
+ val path = this.dir.toString() + "/" + filename
File(path).also { file -> file.parentFile.mkdirs() }.writeText("Foo")
}
@@ -51,7 +52,6 @@
fun closeGitDownState() = this.also {
GitDownState.git.value.close()
}
-
}
fun createTestRepository() =
And specify that I want to stage two specific lines of the first hunk and one line of the second hunk?
Is there a way to do the inverse looking at a staged diff?
Using git, I believe these would be achieved by
git add -p
and
git reset -p
although interactively, which is not what I want.
[Updated on: Tue, 21 June 2022 02:26] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03330 seconds