diff --git a/README.md b/README.md new file mode 100644 index 0000000..2d40bac --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +forge + +expiremental work on federated git + +/usr/share/git-gui/lib/tools/ +.git/config settings for gitgui +[gui] + wmstate = normal + geometry = 931x515+450+130 197 234 + diff --git a/applyPatch.go b/applyPatch.go index 2824407..52713a9 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -62,7 +62,7 @@ func IsValidPatch(p *forgepb.Patch) bool { func IsAnythingDirty() bool { me.found = new(gitpb.Repos) findAll() // select all the repos - doCheckDirty() + doCheckDirtyAndConfigSave() me.found = new(gitpb.Repos) findDirty() if len(me.found.Repos) == 0 { diff --git a/doCommon.go b/doCommon.go index e7ecb70..a085587 100644 --- a/doCommon.go +++ b/doCommon.go @@ -33,7 +33,7 @@ func doGitPull() { } -func doCheckDirty() { +func doCheckDirtyAndConfigSave() { now := time.Now() all := me.found.SortByFullPath() for all.Scan() { @@ -50,11 +50,22 @@ func doCheckDirty() { } } } - // doCobol() log.Info("dirty check took:", shell.FormatDuration(time.Since(now))) me.forge.SetConfigSave(configSave) } +func IsEverythingOnDevel() bool { + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + if repo.GetCurrentBranchName() != repo.GetDevelBranchName() { + log.Info(repo.GetFullPath(), repo.GetCurrentBranchName(), repo.GetDevelBranchName()) + return false + } + } + return true +} + func doGitReset() { all := me.found.SortByFullPath() for all.Scan() { diff --git a/main.go b/main.go index 7895c6d..4cc6181 100644 --- a/main.go +++ b/main.go @@ -110,7 +110,7 @@ func main() { var done bool = false if argv.Dirty != nil { findAll() // select all the repos - doCheckDirty() + doCheckDirtyAndConfigSave() me.found = new(gitpb.Repos) findDirty() doCobol() diff --git a/windowPatches.go b/windowPatches.go index 443103a..6f06637 100644 --- a/windowPatches.go +++ b/windowPatches.go @@ -192,6 +192,10 @@ func submitPatchesBox(box *gui.Node) *patchSummary { if err != nil { return } + if !IsEverythingOnDevel() { + log.Info("You can only apply patches to the devel branch") + return + } if IsAnythingDirty() { log.Info("You can't apply patches when repos are dirty") doCobol()