@@ -97,9 +97,6 @@ var flMaxFailures = pflag.Int("max-failures",
97
97
var flGroupWrite = pflag .Bool ("group-write" ,
98
98
envBool (false , "GITSYNC_GROUP_WRITE" , "GIT_SYNC_GROUP_WRITE" ),
99
99
"ensure that all data (repo, worktrees, etc.) is group writable" )
100
- var flChmod = pflag .Int ("change-permissions" ,
101
- envInt (0 , "GITSYNC_PERMISSIONS" , "GIT_SYNC_PERMISSIONS" ),
102
- "optionally change permissions on the checked-out files to the specified mode" )
103
100
104
101
var flTouchFile = pflag .String ("touch-file" ,
105
102
envString ("" , "GITSYNC_TOUCH_FILE" , "GIT_SYNC_TOUCH_FILE" ),
@@ -192,6 +189,8 @@ var flHTTPprof = pflag.Bool("http-pprof",
192
189
// Obsolete flags, kept for compat.
193
190
var flDeprecatedBranch = pflag .String ("branch" , envString ("" , "GIT_SYNC_BRANCH" ),
194
191
"DEPRECATED: use --ref instead" )
192
+ var flDeprecatedChmod = pflag .Int ("change-permissions" , envInt (0 , "GIT_SYNC_PERMISSIONS" ),
193
+ "DEPRECATED: use --group-write instead" )
195
194
var flDeprecatedDest = pflag .String ("dest" , envString ("" , "GIT_SYNC_DEST" ),
196
195
"DEPRECATED: use --link instead" )
197
196
var flDeprecatedMaxSyncFailures = pflag .Int ("max-sync-failures" , envInt (0 , "GIT_SYNC_MAX_SYNC_FAILURES" ),
@@ -209,6 +208,7 @@ var flDeprecatedWait = pflag.Float64("wait", envFloat(0, "GIT_SYNC_WAIT"),
209
208
210
209
func init () {
211
210
pflag .CommandLine .MarkDeprecated ("branch" , "use --ref instead" )
211
+ pflag .CommandLine .MarkDeprecated ("change-permissions" , "use --group-write instead" )
212
212
pflag .CommandLine .MarkDeprecated ("dest" , "use --link instead" )
213
213
pflag .CommandLine .MarkDeprecated ("max-sync-failures" , "use --max-failures instead" )
214
214
pflag .CommandLine .MarkDeprecated ("rev" , "use --ref instead" )
@@ -482,7 +482,6 @@ type repoSync struct {
482
482
depth int // for shallow sync
483
483
submodules submodulesMode // how to handle submodules
484
484
gc gcMode // garbage collection
485
- chmod int // mode to change repo to, or 0
486
485
link absPath // absolute path to the symlink to publish
487
486
authURL string // a URL to re-fetch credentials, or ""
488
487
sparseFile string // path to a sparse-checkout file
@@ -609,6 +608,10 @@ func main() {
609
608
handleConfigError (log , true , "ERROR: --period must be at least 10ms" )
610
609
}
611
610
611
+ if * flDeprecatedChmod != 0 {
612
+ handleConfigError (log , true , "ERROR: --change-permissions is no longer supported" )
613
+ }
614
+
612
615
var syncSig syscall.Signal
613
616
if * flSyncOnSignal != "" {
614
617
if num , err := strconv .ParseInt (* flSyncOnSignal , 0 , 0 ); err == nil {
@@ -795,7 +798,6 @@ func main() {
795
798
depth : * flDepth ,
796
799
submodules : submodulesMode (* flSubmodules ),
797
800
gc : gcMode (* flGitGC ),
798
- chmod : * flChmod ,
799
801
link : absLink ,
800
802
authURL : * flAskPassURL ,
801
803
sparseFile : * flSparseCheckoutFile ,
@@ -1532,15 +1534,6 @@ func (git *repoSync) configureWorktree(ctx context.Context, worktree worktree) e
1532
1534
}
1533
1535
}
1534
1536
1535
- // Change the file permissions, if requested.
1536
- if git .chmod != 0 {
1537
- mode := fmt .Sprintf ("%#o" , git .chmod )
1538
- git .log .V (1 ).Info ("changing file permissions" , "mode" , mode )
1539
- if _ , err := git .run .Run (ctx , "" , nil , "chmod" , "-R" , mode , worktree .Path ().String ()); err != nil {
1540
- return err
1541
- }
1542
- }
1543
-
1544
1537
return nil
1545
1538
}
1546
1539
@@ -2250,9 +2243,6 @@ OPTIONS
2250
2243
(200) and produce a series of key=value lines, including
2251
2244
"username=<value>" and "password=<value>".
2252
2245
2253
- --change-permissions <int>, $GITSYNC_PERMISSIONS
2254
- Change permissions on the checked-out files to the specified mode.
2255
-
2256
2246
--cookie-file <string>, $GITSYNC_COOKIE_FILE
2257
2247
Use a git cookiefile (/etc/git-secret/cookie_file) for
2258
2248
authentication.
@@ -2327,7 +2317,7 @@ OPTIONS
2327
2317
checked out files, worktrees, and symlink) are all group writable.
2328
2318
This corresponds to git's notion of a "shared repository". This is
2329
2319
useful in cases where data produced by git-sync is used by a
2330
- different UID.
2320
+ different UID. This replaces the older --change-permissions flag.
2331
2321
2332
2322
-h, --help
2333
2323
Print help text and exit.
0 commit comments