--filter=[origin/main] vs --filter=[origin/main...HEAD] #8956
-
SummaryTLDR - What is the difference bettween Context : Initially, I saw a few people using Then I moved onto using So I made something complicated But in my head, Additional informationFound this thread which also states that HEAD is chosen as the default value - #1442 (comment) I tried the following in my local -
The I ran the following commands on the harshit@Harshits-MBP Project % npm run unit-test -- --filter="[origin/turbo-test-branch-1]" --graph
> monorepo@0.0.1 unit-test
> dotenv -- turbo unit-test --filter=[origin/turbo-test-branch-1] --graph
digraph {
compound = "true"
newrank = "true"
subgraph "root" {
"[root] backend#unit-test" -> "[root] ___ROOT___"
"[root] hub#unit-test" -> "[root] ___ROOT___"
}
}
harshit@Harshits-MBP Project % npm run unit-test -- --filter="[origin/turbo-test-branch-1...HEAD]" --graph
> monorepo@0.0.1 unit-test
> dotenv -- turbo unit-test --filter=[origin/turbo-test-branch-1...HEAD] --graph
digraph {
compound = "true"
newrank = "true"
subgraph "root" {
"[root] hub#unit-test" -> "[root] ___ROOT___"
}
} We can see that ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey, yeah this is subtle and slightly confusing. If a git range has a defined end, e.g. However, I don't think that's your issue. The other main difference is that We likely could do a better job of explaining this, but also, this is basically git's behavior one to one. Fun note, |
Beta Was this translation helpful? Give feedback.
Hey, yeah this is subtle and slightly confusing. If a git range has a defined end, e.g.
[a...b]
, we do not include staged or uncommitted changes. If it has only a start, e.g.[a]
, we include staged or uncommitted changes.However, I don't think that's your issue. The other main difference is that
[a...b]
underneath the hood callsgit diff a...b
, while[a]
callsgit diff a
. Note the three dots ina...b
. This gets the diff between the merge-base ofa
andb
andb
(git docs). This is effectively getting the diff that is your branch. Withgit diff a
, that's getting the difference betweena
and your current commit (git docs). So in the case where that'smain
, that will include both the code add…