Add --branch flag

andybalholm
Mar 14, 2023, 1:14 AM
OLMQ7EVU4GITQMACZRI7VEGXG7GMZ4ZVKU4BNQUAJS3GEIBEOJMAC

Dependencies

  • [2] P2B4ZSO5 Include file content
  • [3] 534I6MRX Add --channel flag
  • [4] DKHKVC66 Add a README
  • [5] 5ETDKF5F Start on data structures to represent fast-export stream
  • [*] Y7VFVY6E Initial dummy version
  • [*] RTQQLOCO Use real metadata, but no content yet

Change contents

  • edit in main.go at line 16
    [3.72]
    [7.73]
    var branch = flag.String("branch", "", "destination branch in Git (default is the same as channel)")
  • edit in main.go at line 49
    [8.422]
    [8.422]
    if *branch == "" {
    *branch = *channel
    }
  • edit in main.go at line 106
    [5.109]
    [8.1392]
    commit.Branch = *branch
  • edit in fast-export.go at line 22
    [2.1303]
    [2.1303]
    Branch string
  • replacement in fast-export.go at line 31
    [5.470][5.470:542]()
    if _, err := fmt.Fprintln(w, "commit refs/heads/master"); err != nil {
    [5.470]
    [5.542]
    if _, err := fmt.Fprintln(w, "commit refs/heads/"+c.Branch); err != nil {
  • replacement in README.md at line 15
    [4.218][4.218:280]()
    The result is a Git repository with a single branch (master),
    [4.218]
    [4.280]
    The result is a Git repository with a single branch (main),
  • replacement in README.md at line 18
    [4.397][4.397:468]()
    (If you want to use a different channel, specify it with `--channel`.)
    [4.397]
    (If you want to use a different channel, specify it with `--channel`.
    The destination branch will have the same name as the source channel,
    unless you specify it with `--branch`.)