[llvm-dev] RFC: Move the test-suite LLVM project to GitHub?
Joachim Durchholz via llvm-dev
llvm-dev at lists.llvm.org
Thu Feb 25 09:10:28 PST 2016
Am 25.02.2016 um 17:25 schrieb Sanjoy Das:
> One thing to watch out for: by default, in git, only the commit date
> (and not the *push date*) is part of the commit metadata. This means
> if I write a patch today and push it two months later, the commit date
> on the commit will be skewed by two months.
Option 1: Rewrite your local history so that the last commit was done on
the day you push; the command is "git commit --amend".
Option 2: Edit the changelog to reflect that you pushed something. This
is the cleanest option in the sense that if the push history is
relevant, this should probably be in the changelog.
Option 3: Postpone the commit to the day you push. This is only feasible
if you have that work in a separate tree that you don't need to touch
between last commit and push. Even then this isn't the first thing that
I'd do, but maybe your use case is better suited for that.
Option 4: When merging the topic branch into the master branch before
pushing, do "git merge --no-ff". This will create a merge commit even if
the merge would run as a fast-forward, non-commit-creating merge. This
is the "official way" to achieve what you want, if you have push rights.
> We could fix this using a
> hook, but then the complication is that as soon as the hook changes
> the commit date to `date`, the SHA-1 of the newly edited commit will
> change.
From the various "cool tricks around git" websites that I have seen
over time, most strongly advise against modifying the tree in hooks even
when it's possible at all.
Most highlight that the committer will have to remember to git pull from
origin, otherwise they will have to merge before the next push. I dimly
recall having seen mentions of more troubles down that road, but I
forgot the details.
More information about the llvm-dev
mailing list