• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    36
    arrow-down
    2
    ·
    2 days ago

    … if you have a super janky patch file workflow.

    If you are using Git like normal people do this can’t happen.

        • The_Decryptor@aussie.zone
          link
          fedilink
          English
          arrow-up
          2
          ·
          39 minutes ago

          Sourcehut uses it, it’s actually the only way to interact with repos hosted on it.

          It definitely feels outdated, yet it’s also how git is designed to work well with. Like git makes it really easy to re-write commit history, while also warning you not to force push re-written history to a public repo (Like e.g. a PR), that’s because none of that is an issue with the email workflow, where each email is always an entirely isolated new commit.

      • Kissaki@programming.dev
        link
        fedilink
        English
        arrow-up
        16
        ·
        2 days ago

        … which arguably makes them not “normal people” (referring to the earlier comment).

        Surely, most people use different, more integrated tooling.

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        7
        arrow-down
        1
        ·
        2 days ago

        Yeah it’s mad. Tbh I don’t think GitHub PRs are the best workflow, but I absolutely know that git send-email is the worst. I tried to use it once to contribute to OpenSBI, which inexplicably also insists on it. Suffice it to say my patch was never merged…

          • FizzyOrange@programming.dev
            link
            fedilink
            arrow-up
            4
            ·
            1 day ago

            They wanted me to make some changes and with the normal workflow that’s just git commit and git push. With git send-email I have no fucking idea and it got beyond the point where I had enough cared enough to fight the process.

            • Tempy@programming.dev
              link
              fedilink
              English
              arrow-up
              2
              ·
              2 hours ago

              I would have thought that you fix it locally, git commit, and regenerate the patch set again. Maybe with optional squashing of commits so each patch set doesn’t keep growing.

            • ElBarto@piefed.social
              link
              fedilink
              English
              arrow-up
              4
              ·
              13 hours ago

              Oh I see! Thanks. I thought that they deliberately rejected your patch. But it was more about the red tape getting in the way. Yeah, that sounds frustrating.

  • Oinks@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    9
    ·
    2 days ago

    Hooray to underspecified file formats.

    From patch(1):

    patch tries to skip any leading garbage, apply the diff, and then skip any trailing garbage. Thus you could feed an email message containing a diff listing to patch, and it should work.

    From git-am(1):

    The patch is expected to be inline, directly following the message. Any line that is of the form:

    • three-dashes and end-of-line, or
    • a line that begins with “diff -”, or
    • a line that begins with "Index: "

    is taken as the beginning of a patch, and the commit log message is terminated before the first occurrence of such a line.

    Ideally git-am should use a better file format, but I suppose the more realistic lesson now is to never have inline diffs in Commit messages.

  • verstra@programming.dev
    link
    fedilink
    arrow-up
    8
    arrow-down
    2
    ·
    2 days ago

    Context: this happens if you use patch(1) with patches generated by git format-patch. If you do, you should be using git am instead.