Skip to content

Commit 26f9233

Browse files
authored
Fix inconsistent commit ordering for git log (#213)
# Exercise Review ## Exercise Discussion Fix #212 ## Checklist - [ ] If you require a new remote repository on the `Git-Mastery` organization, have you [created a request](https://github.com/git-mastery/exercises/issues/new?template=request_exercise_repository.md) for it? - [ ] Have you written unit tests using [`repo-smith`](https://github.com/git-mastery/repo-smith) to validate the exercise grading scheme? - [X] Have you tested your changes using the instructions posted? - [X] Have you verified that this exercise does not already exist or is not currently in review? - [ ] Did you introduce a new grading mechanism that should belong to [`git-autograder`](https://github.com/git-mastery/git-autograder)? - [ ] Did you introduce a new dependency that should belong to [`app`](https://github.com/git-mastery/app)?
1 parent ca5dfeb commit 26f9233

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

hands_on/branch_delete.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import time
12
import os
23

34
from exercise_utils.file import create_or_update_file
@@ -30,4 +31,9 @@ def download(verbose: bool):
3031
commit("Add fantasy.txt", verbose)
3132

3233
checkout("main", False, verbose)
34+
35+
# Sleep to ensure that the commit timestamps are different to ensure correct git revision graph in git log
36+
time.sleep(1)
37+
38+
3339
merge_with_message("textbooks", False, "Merge branch textbooks", verbose)

hands_on/branch_rename.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import time
12
import os
23

34
from exercise_utils.file import create_or_update_file
@@ -43,4 +44,8 @@ def download(verbose: bool):
4344
commit("Add fantasy.txt", verbose)
4445

4546
checkout("main", False, verbose)
47+
48+
# Sleep to ensure that the commit timestamps are different to ensure correct git revision graph in git log
49+
time.sleep(1)
50+
4651
merge_with_message("textbooks", False, "Merge branch textbooks", verbose)

hands_on/early_branch.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import time
12
import os
23

34
from exercise_utils.file import create_or_update_file, append_to_file
@@ -62,4 +63,8 @@ def download(verbose: bool):
6263
checkout("main", False, verbose)
6364
append_to_file("tennis.txt", "Martina Navratilova")
6465
add(["tennis.txt"], verbose)
66+
67+
# Sleep to ensure that the commit timestamps are different to ensure correct git revision graph in git log
68+
time.sleep(1)
69+
6570
commit("Add Martina to tennis.txt", verbose)

0 commit comments

Comments
 (0)