git export: what's extent of the effects of amend in the exported repo?
(1) By Marcelo Huerta (richieadler) on 2020-02-20 00:02:09 [link] [source]
I had a repository I wanted to publish in Github. I noticed that the user I used for the checkins was my local username instead of my Github username, so I amend
ed all the checkins to change the user name.
In Fossil, they show correctly, but in Git, for all the checkins the author remains the original one.
Does an amend
affect the artifacts exported to Git? If so, how?
(2) By Richard Hipp (drh) on 2020-02-20 01:20:28 in reply to 1 [link] [source]
Does an amend affect the artifacts exported to Git? If so, how?
Unfortunately, it does not, as there is no way to export that information to git, at least not that I know of. In other words, git lacks the capability to amend a prior check-in like Fossil. So, just like the wiki and tickets and forum of Fossil cannot be exported to git, amendments to check-ins cannot be exported.
I have the same problem with the SQLite repository clone on GitHub. If we fix a typo in the check-in comment, or similar, those changes only reach GitHub if I make the change prior to the hourly sync.
(3) By anonymous on 2020-02-20 02:07:25 in reply to 2 [link] [source]
Why not apply the amendments to a temporary copy of the commit then create the git commit from that?
(8) By Marcelo Huerta (richieadler) on 2020-04-24 15:14:35 in reply to 3 [link] [source]
Why not apply the amendments to a temporary copy of the commit then create the git commit from that?
Has any thought been given to this? A consolidated copy, including the results of all the amendments since the last push, could solve the problem I was seeing.
(9) By anonymous on 2020-04-25 22:16:08 in reply to 8 [link] [source]
Actually, the problem is that amend is being done after the commit in question was exported to Git. While, as another poster pointed out, the new info can be exported to Git, but Git doesn't display the amended version. It won't even tell you the amendment exists.
(10) By Marcelo Huerta (richieadler) on 2020-04-26 17:02:57 in reply to 9 [link] [source]
But I'm referring to the case where, for instance, a Fossil repository has never been pushed to Git, but it has several amended artifacts. At that point a composite with fixed information could be pushed.
Or, the autopush was off and then on again and, since the last push, several commits happened with amends, and a resulting set could be synced with the amends.
(11) By anonymous on 2020-04-28 04:37:41 in reply to 10 [link] [source]
But I'm referring to the case where, for instance, a Fossil repository has never been pushed to Git, but it has several amended artifacts.
I've never had the occasion to test fossil git export
, but I recall reading some comments that imply Fossil already does that.
If not, then I agree, it should.
(4) By anonymous on 2020-02-23 17:35:52 in reply to 2 [link] [source]
Unfortunately, it does not, as there is no way to export that information to git
Sort of.... "Annotated tags" can be applied and pushed (with the --tags option).
But the tag is a separate entity, so while the information in the tag's message will be present, it seems (as best I can tell) you have to know the tag is there to see it.
(5) By sekao on 2020-03-28 14:09:33 in reply to 1 [link] [source]
I have a related question so i figured i'd just add it here. I renamed a branch in fossil, but when i run fossil git export
it just says "no changes". Is that expected? I was hoping it would make a branch in git with the new name. Will future commits continue to be under the old name in the git mirror?
(6) By anonymous on 2020-03-28 14:40:21 in reply to 5 [link] [source]
I was hoping it would make a branch in git with the new name.
Given that a branch in Git is just a pointer to the latest commit in a chain of commits, this should work as expected.
fossil git export
saying "no changes" suggests to me that Fossil may be waiting until there's a commit under the new name before creating a new brnach in Git. I don't think this is necessary as git branch MyNewBranch
creates a new, named pointer and initializes it to the current commit.
(7.1) By sekao on 2020-03-28 16:26:52 edited from 7.0 in reply to 6 [source]
fossil changes
returns nothing and fossil timeline
shows the rename (a line that says "Move to branch") so it doesn't look like anything is uncommitted. It's fine it this is just a mismatch between fossil and git though; i'm not even sure how a rename should treat the old branch on the git side (i.e. should it be deleted or left there).
EDIT: looks like i just misunderstood your comment. You are right -- i just had to make a commit on the new branch. it appears that the old branch remains on git, BTW.