{"thread":{"id":"60354","subject":"git and multiple processes","startedAt":"2023-10-12T18:28:59Z","lastAt":"2023-10-12T18:28:59Z","messageCount":1,"participants":["Federico Kircheis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483166","messageId":"88905bf2-480b-4aa7-bd1d-a13efa31d8d8@kircheis.it","threadId":"60354","inReplyTo":null,"subject":"git and multiple processes","fromName":"Federico Kircheis","fromEmail":"federico@kircheis.it","sentAt":"2023-10-12T18:28:44Z","receivedAt":"2023-10-12T18:28:59Z","isPatch":false,"sender":{"key":"federico@kircheis.it","avatar":null},"body":"Hello,\n\nI wanted to know if concurrent command can \"break\" a repository, ie put \nit in an inconsistent state.\n\nI suppose that as long all commands are only querying the status (log, \nreflog, status, ....) then such a thing will not happen.\n\nI guess that if only one command changes the status (add, commit, pull, \nfetch, push, ...) then the output might be \"wrong\", but the command that \nqueries the status does not interfere with the others.\n\nBut what if two commands that change the status?\nFor example a git fetch and git add or git commit at the same time?\n\n\nA use-case I had recently was me doing \"git commit -p\" from one console, \nand noticing a change I wanted to undo.\nI skipped the change, and while \"git commit -p\" showed me the next diff, \nI opened another console.\n From there, I did a \"git checkout\", and reverted the change I just skipped.\n\nIs such use-case supported?\n\nEverything worked as I expected, but it would be nice to know that I did \nnot \"risk\" anything.\n\nThe use-cases I am most interested in is when working with worktrees.\n\nWhat if I add a worktree, and \"work concurrently\" in two worktrees?\nFor example while git is switching branches in one worktree, doing a \ncommit in another worktree (assuming I'm not switching to the branch \nwhere I am committing)\nWhat if I am doing an automated \"git bisect\" in a worktree.\nCan I work in another one (doing commits, fetch, rebase, reflog, stash, \n...)?\nWhat if I have a cron job that executes  \"git fetch\" in one worktree.\nIs it problematic if I happen to execute git fetch at the same time from \nanother worktree?\nIf those use-cases are not problematic, as all repositories are linked \ntogether, what are possible issues (ignoring bugs).\n\nCommon sense tells me that those operations are supported, but I could \nnot find any reference, or if there are some guarantees that git wants \nto hold, no matter what the current status is.\n\nBest\n\nFederico\n"}]}