Fossil SCM

Make "fossil import" read the --git options when neither --git nor --svn is given, as the help text says git is the default. Without --git the master branch got an empty name and --import-marks, --export-marks, --rename-master, --use-author and --attribute were refused.

dmestas 2026-11-20 21:26 UTC small-fixes
Commit 149cdcff9112680facde6e047e92425e0a62ba8ea8fb8ca819186e18f2e011be
1 file changed +2 -2
+2 -2
--- src/import.c
+++ src/import.c
@@ -1831,11 +1831,10 @@
18311831
char *zPassword;
18321832
FILE *pIn;
18331833
Stmt q;
18341834
int forceFlag = find_option("force", "f", 0)!=0;
18351835
int svnFlag = find_option("svn", 0, 0)!=0;
1836
- int gitFlag = find_option("git", 0, 0)!=0;
18371836
int omitRebuild = find_option("no-rebuild",0,0)!=0;
18381837
int omitVacuum = find_option("no-vacuum",0,0)!=0;
18391838
const char *zDefaultUser = find_option("admin-user","A",1);
18401839
18411840
/* Options common to all input formats */
@@ -1881,10 +1880,11 @@
18811880
}
18821881
if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){
18831882
gimport.zTrunkName = fossil_strdup(db_main_branch());
18841883
}
18851884
1885
+ find_option("git", 0, 0);
18861886
if( svnFlag ){
18871887
/* Get --svn related options here, so verify_all_options() fails when
18881888
* svn-only options are specified with --git
18891889
*/
18901890
const char *zIgnTree;
@@ -1902,11 +1902,11 @@
19021902
gsvn.zTrunk = find_option("trunk", 0, 1);
19031903
gsvn.zBranches = find_option("branches", 0, 1);
19041904
gsvn.zTags = find_option("tags", 0, 1);
19051905
gsvn.revFlag = find_option("rev-tags", 0, 0)
19061906
|| (incrFlag && !find_option("no-rev-tags", 0, 0));
1907
- }else if( gitFlag ){
1907
+ }else{
19081908
const char *zGitUser;
19091909
markfile_in = find_option("import-marks", 0, 1);
19101910
markfile_out = find_option("export-marks", 0, 1);
19111911
if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){
19121912
ggit.zMasterName = "master";
19131913
--- src/import.c
+++ src/import.c
@@ -1831,11 +1831,10 @@
1831 char *zPassword;
1832 FILE *pIn;
1833 Stmt q;
1834 int forceFlag = find_option("force", "f", 0)!=0;
1835 int svnFlag = find_option("svn", 0, 0)!=0;
1836 int gitFlag = find_option("git", 0, 0)!=0;
1837 int omitRebuild = find_option("no-rebuild",0,0)!=0;
1838 int omitVacuum = find_option("no-vacuum",0,0)!=0;
1839 const char *zDefaultUser = find_option("admin-user","A",1);
1840
1841 /* Options common to all input formats */
@@ -1881,10 +1880,11 @@
1881 }
1882 if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){
1883 gimport.zTrunkName = fossil_strdup(db_main_branch());
1884 }
1885
 
1886 if( svnFlag ){
1887 /* Get --svn related options here, so verify_all_options() fails when
1888 * svn-only options are specified with --git
1889 */
1890 const char *zIgnTree;
@@ -1902,11 +1902,11 @@
1902 gsvn.zTrunk = find_option("trunk", 0, 1);
1903 gsvn.zBranches = find_option("branches", 0, 1);
1904 gsvn.zTags = find_option("tags", 0, 1);
1905 gsvn.revFlag = find_option("rev-tags", 0, 0)
1906 || (incrFlag && !find_option("no-rev-tags", 0, 0));
1907 }else if( gitFlag ){
1908 const char *zGitUser;
1909 markfile_in = find_option("import-marks", 0, 1);
1910 markfile_out = find_option("export-marks", 0, 1);
1911 if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){
1912 ggit.zMasterName = "master";
1913
--- src/import.c
+++ src/import.c
@@ -1831,11 +1831,10 @@
1831 char *zPassword;
1832 FILE *pIn;
1833 Stmt q;
1834 int forceFlag = find_option("force", "f", 0)!=0;
1835 int svnFlag = find_option("svn", 0, 0)!=0;
 
1836 int omitRebuild = find_option("no-rebuild",0,0)!=0;
1837 int omitVacuum = find_option("no-vacuum",0,0)!=0;
1838 const char *zDefaultUser = find_option("admin-user","A",1);
1839
1840 /* Options common to all input formats */
@@ -1881,10 +1880,11 @@
1880 }
1881 if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){
1882 gimport.zTrunkName = fossil_strdup(db_main_branch());
1883 }
1884
1885 find_option("git", 0, 0);
1886 if( svnFlag ){
1887 /* Get --svn related options here, so verify_all_options() fails when
1888 * svn-only options are specified with --git
1889 */
1890 const char *zIgnTree;
@@ -1902,11 +1902,11 @@
1902 gsvn.zTrunk = find_option("trunk", 0, 1);
1903 gsvn.zBranches = find_option("branches", 0, 1);
1904 gsvn.zTags = find_option("tags", 0, 1);
1905 gsvn.revFlag = find_option("rev-tags", 0, 0)
1906 || (incrFlag && !find_option("no-rev-tags", 0, 0));
1907 }else{
1908 const char *zGitUser;
1909 markfile_in = find_option("import-marks", 0, 1);
1910 markfile_out = find_option("export-marks", 0, 1);
1911 if( !(ggit.zMasterName = find_option("rename-master", 0, 1)) ){
1912 ggit.zMasterName = "master";
1913

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button