Skip to content

Instantly share code, notes, and snippets.

@lfittl
Created January 26, 2011 21:36
Show Gist options
  • Select an option

  • Save lfittl/797522 to your computer and use it in GitHub Desktop.

Select an option

Save lfittl/797522 to your computer and use it in GitHub Desktop.
Fix for fossil's git export function
diff --git a/src/export.c b/src/export.c
index d776854..2a91805 100644
--- a/src/export.c
+++ b/src/export.c
@@ -41,7 +41,7 @@ static void print_person(const char *zUser){
db_reset(&q);
for(i=0; zUser[i] && zUser[i]!='>' && zUser[i]!='<'; i++){}
if( zUser[i]==0 ){
- printf(" <%s>", zUser);
+ printf(" %s <%s>", zUser, zUser);
return;
}
zName = mprintf("%s", zUser);
@@ -101,7 +101,7 @@ static void print_person(const char *zUser){
void export_cmd(void){
Stmt q;
int i;
- int firstCkin; /* Integer offset to check-in marks */
+ int firstCkin; /* Offset to seperate blob marks from check-in marks */
Bag blobs, vers;
bag_init(&blobs);
bag_init(&vers);
@@ -130,7 +130,7 @@ void export_cmd(void){
/* Output the commit records.
*/
- firstCkin = db_int(0, "SELECT max(rid) FROM blob")+1;
+ firstCkin = db_int(0, "SELECT max(fid) FROM mlink")+1;
db_prepare(&q,
"SELECT strftime('%%s',mtime), objid, coalesce(comment,ecomment),"
" coalesce(user,euser),"
@lfittl

lfittl commented Jan 26, 2011

Copy link
Copy Markdown
Author

FYI - The first hunk is unrelated to the blob/commit mark number issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment