forked from mirrors/jj
cli: add inline comment about racy Git HEAD updates
This is the source of the problem I noticed when debugging #924 and #1608. I don't think this can be easily fixed, so let's document it.
This commit is contained in:
parent
3207009e73
commit
1330381fc6
1 changed files with 10 additions and 0 deletions
|
@ -841,6 +841,16 @@ impl WorkspaceCommandHelper {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
// TODO: There are various ways to get duplicated working-copy
|
||||
// commits. Some of them could be mitigated by checking the working-copy
|
||||
// operation id after acquiring the lock, but that isn't enough.
|
||||
//
|
||||
// - moved HEAD was observed by multiple jj processes, and new working-copy
|
||||
// commits are created concurrently.
|
||||
// - new HEAD was exported by jj, but the operation isn't committed yet.
|
||||
// - new HEAD was exported by jj, but the new working-copy commit isn't checked
|
||||
// out yet.
|
||||
|
||||
let mut tx = tx.into_inner();
|
||||
let old_git_head = self.repo().view().git_head().clone();
|
||||
let new_git_head = tx.mut_repo().view().git_head().clone();
|
||||
|
|
Loading…
Reference in a new issue