-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Wrong commit order #779
Comments
Hi, I wrote an integration test to cover this: describe('log-commit-order', () => {
it('commits and logs in chronological order', async () => {
const context = await createTestContext();
await setUpInit(context);
const git = newSimpleGit(context.root);
const hashes: string[] = [];
await setUpFilesAdded(context, ['first'], '.',' commit 1');
hashes.push(await git.revparse('HEAD'));
await git.checkout(['-b', 'new_branch']);
await setUpFilesAdded(context, ['second'], '.',' commit 2');
hashes.push(await git.revparse('HEAD'));
await git.addTag('new_tag');
await git.checkout('master');
const tagHashes = (await git.log(['new_tag']))
.all
.map(({hash}) => hash);
expect(hashes).toEqual(tagHashes.reverse());
});
}) And found that I always had Is it possible that some other process is accessing |
I'm using this code inside of a NodeJS/ExpressJS API running in dev mode, so there is the chance that there are more than one process spinned up.
I mean, all the commits and branching/tagging are done by a single API call, is there a way to make this work as expected? |
I'm seeing some cases where the git history shows commits in the wrong order from which they were created.
Here is my code:
What I expected was to always branch
new_branch
from thecommit 1
, but sometimes the branch is made before thecommit 1
.Result:
It seems that commit
4282224
and1752c05
are in the wrong order.I'm I doing something wrong or is this the expected behaviour?
The text was updated successfully, but these errors were encountered: