Fossil

Check-in [01231dcb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When importing a git fast-import, we silently change master branch to trunk to match the default fossil naming conventions. So when we export to the git fast-import format, we should silently change the trunk branch back into master to match the git naming conventions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | roy-export
Files: files | file ages | folders
SHA1:01231dcb5e1bec7125c0211159bd0370e383bdbe
User & Date: roy.marples 2017-02-10 01:44:45
Context
2017-02-10
13:03
Style check-in: 8e707973 user: roy.marples tags: roy-export
01:44
When importing a git fast-import, we silently change master branch to trunk to match the default fossil naming conventions. So when we export to the git fast-import format, we should silently change the trunk branch back into master to match the git naming conventions. check-in: 01231dcb user: roy.marples tags: roy-export
01:25
Add function print_ref to sanitize branch and tag names in accordance with https://git-scm.com/docs/git-check-ref-format

Use this rather than simply replacing non alpha or numeric chars for branch and tag names when exporting. check-in: abc87ccd user: roy.marples tags: roy-export

Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/export.c.

   609    609       const char *zBranch = db_column_text(&q, 4);
   610    610       char *zMark;
   611    611   
   612    612       bag_insert(&vers, ckinId);
   613    613       db_bind_int(&q2, ":rid", ckinId);
   614    614       db_step(&q2);
   615    615       db_reset(&q2);
   616         -    if( zBranch==0 ) zBranch = "trunk";
          616  +    /* fossil trunk is git master. */
          617  +    if( zBranch==0 || fossil_strcmp(zBranch, "trunk") == 0 ) zBranch = "master";
   617    618       zMark = mark_name_from_rid(ckinId, &unused_mark);
   618    619       printf("commit refs/heads/");
   619    620       print_ref(zBranch);
   620    621       printf("\nmark %s\n", zMark);
   621    622       free(zMark);
   622    623       printf("committer");
   623    624       print_person(zUser);