Amend commit time requires kart upgrade? #916
-
Is it possible to amend the commit time? I'm interested in adapting some old data that is available as a series of point-in-time archives into a single Kart repository, but ideally I want the commit date to be the date the archive was made, not the datetime I've made the Kart commit. To me it seems sensible to make a commit, then amend the commit time. Starting with a new repo and GPKG with only an init commit: kart git commit --amend --date="Tue 28 Mar 03:01:20 2023 +0000" --no-edit
So far so good. kart log
Kart log had no issues before; i.e. I don't get this error before the amend operation. Perhaps Kart version checking relies on commit dates? If I
Actually my upgraded repository has the correct commit message and amended date, but no working copy. If I create one, it's empty. I'm new to kart so might be missing something though. When I upgrade, how do I also keep the working copy? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
OK you've found some rough edges of Kart here unfortunately - I'll have to file some issues against myself. Things have gone wrong earlier than the Since Git doesn't understand the Kart working copy, for technical reasons, the command you ran actually overwrites your commit with an empty commit, which is not what you want. This is why I should hide this command better. Finally, the sort of thing you are trying to do is not so straight-forward in Kart - Git has innumerable commands, flags, environment variables, etc that let you modify your repository in any way, Kart has much less, and using the Git ones can go wrong. Nevertheless, it is possible - here is a Kart command which does it: (This command generally lets you store arbitrary files in your Kart repo, but in this case we're telling it to add zero files but to amend the commit and keep the same message) But first you'll need to start over to fix the previous command - there are other ways, but probably recreating the repo from scratch is easiest. |
Beta Was this translation helpful? Give feedback.
-
Just as a comment for anyone else who may be following this thread in the future, there's a difference between "AuthorDate" and "CommitDate" in git. It seems appropriate to adjust the CommitDate but to leave the AuthorDate as is. You can see both with |
Beta Was this translation helpful? Give feedback.
-
Link to my experimentation https://gist.github.com/alpha-beta-soup/26d7116bbc53a47fa3ce9cf7f9cd76f2 |
Beta Was this translation helpful? Give feedback.
OK you've found some rough edges of Kart here unfortunately - I'll have to file some issues against myself.
Things have gone wrong earlier than the
kart upgrade
- this is a red herring, thekart git
command you ran has corrupted your commit already and left it empty. (Running arbitrarykart git
commands is not guaranteed to leave your kart repository in a good state, since, Git doesn't understand what a Kart repository is or how to make sure it is left in a good state. That needs to be better documented, or thekart git
command should be better hidden - that's the first issue)Since Git doesn't understand the Kart working copy, for technical reasons, the command you ran actually overwrite…