Forbidding a project from being forked on GitHub

Fellow Fortraners, I am about to release a Fortran project under a permissive license (most probably zlib). I doubt this project would get much attention to be forked, but just in case, is it possible to forbid forking, cloning (or whatever else) on GitHub, specifically? Anywhere else would be fine.

I do not post this to start arguing against GitHub. I just wish my projects never being there in any form. Does anyone have previous experience about such “special” requirements in licenses? I am thinking to just add this as an additional requirement to the zlib license, but I’m not sure this would be enough.

Not that I know of. Having the option to turn it off as button on GitHub doesn’t really buy you that much, since somebody could just clone it a push to a new repo manually, and then you don’t necessarily see the link back to the original. Better to make it easier to click the fork button and see when that happens.

TLDR; once you’ve made source code public, you don’t have much control over what people do with it afterwards.

You could add it as a constraint in your license, and try and prominently display it, but the onus would be on you to police GitHub and litigate it if you really care about it.

2 Likes

My understanding is that @Pap is not opposed to a fork of his project, but he wants to specifically exclude GitHub from the potential hosts.

1 Like

Yes, @pap you can only put that in your own license and put a clear warning at the top of your README.md file, hoping people will respect your will. If someone does not, it would be interesting to see if it is possible to signal to GitHub the license violation, hoping once again they would act against it.

Well, “hope” is the key word…

Obviously, I’m going to interpret the second part as a joke.

@PierU: Precisely.
Like I said, I doubt anyone would care that much to fork this project of mine, but just in case it happens, I want to prevent them from forking, cloning, or otherwise have any part of my work published on GitHub.
Otherwise, I don’t care about forking, as long it is within reason. And I added “within reason” because if you search GitHub for pretty much any library, you will find a whole lot of “different” projects that were forked from the original for absolutely no reason, other than having the person who forked being present as a “developer” on that platform.

I’ve already added a constraint in the (zlib) license saying exactly that, but it sounds a bit unusual or weird - which is what I was trying to avoid. That’s why I asked if someone had seen something similar (not necessarily concerning GitHub, just a similar constraint for a specific host, institution, organization, whatever, that was specifically excluded in a license.)
A constraint will just serve as a reminder that even if someone forks on GitHub, at least it would be apparent they did so without the original author’s permission. But, again, I doubt anyone would want to fork anyway, so it is mostly a “theoretical” question.

It sounds like you just shouldn’t publish on GitHub.

2 Likes

Of course I won’t, but that has nothing to do with the question. The problem is how to prevent someone else from forking my work there. Specifically on GitHub, I don’t care if it’s anywhere else.

I cannot provide legal advice, but you might find inspiration in, for example, the Fedora Export Control Policy, which imposes constraints on the permitted use cases of an open-source product. Some time ago, I wondered if I could prohibit the use of my code in certain countries, such as Russia or China. However, I asked myself, would anyone living in those countries ever care about this policy?

Yes, technically you can’t do anything.
The question is then finally: are you ready to go to court?

I’m confused. Forking or cloning on GitHub requires that your project is on GitHub in the first place.

Are you instead asking how to prevent someone from uploading a copy of your software (obtained elsewhere) to their own repo on GitHub?

If yes, you can add that clause to your software license. For example:

“This license prohibits distributing a copy of the software on GitHub.”

1 Like

And then, GitHub is purchased by Elon and changes its name to X-Hub. :rofl:

@Pap, speaking seriously, why don’t you simply add a point to the license and contact GitHub if the license is violated?

3 Likes

Yes, that is the question: how to contact GitHub?
As far as I can see, in a repository there is no equivalent of an “inappropriate content” button to report a problem.

I have just found: https://docs.github.com/fr/site-policy/github-terms/github-terms-of-service#2-github-may-remove-content

1 Like

Open an issue redirects to this. But this is amazing, I would never imagine contacting GitHub is so hard. :frowning_with_open_mouth:

Also, policy@github.com

Take this as speculation only: I thought open-source style licenses effectively rely on copyright and that violating the license amounts to a breach of copyright. So after licensing your code with a “don’t post on github” clause, you could look into sending a DMCA takedown notice to github if anybody posts your code there, as they (github) would be hosting content that violates your copyright. They have a process for this: Guide to Submitting a DMCA Takedown Notice - GitHub Docs

1 Like

An other approach may rely on code obfuscation. Though I know about FPT/WinFPT by simcon only because of one of the monthly calls where it was presented as a tool to bring elder FORTRAN source code to modern Fortran, the program equally includes this as a security feature. The developers illustrate this by passing a snippet «part of an (unclassified) F16 aircraft model» of

      REAL    THTL,   THRSTKN
      REAL    YREFR,  ZREFR
      REAL    YREFT,  ZREFT
C
      REAL    TGEAR
C
      SAVE
C
C
C *********************************************************
C ***             Start of executable code              ***
C *********************************************************
C
C**********************************************************
C***                  Engine dynamics                   ***
C**********************************************************
C
C Initialize the engine power at the initial throttle
C
      IF (FPASS .EQ. 1) THEN
         ZPOW = TGEAR(THROT)
         POW  = TGEAR(THROT)
      ENDIF
C
C Throttle gearing
C
      CPOW =  TGEAR(THROT)
C
C Actual power lag
c ...bypass first order lag, if TENLAG = 0
C
      IF (TENLAG .GE. 0.5) THEN
         CALL PDOT(POW,CPOW,ZPOW)
      ELSE
         POW = CPOW
      ENDIF
C
C Gross thrust look-up table (look up table in metric)
C ...We have no mass flow data, so we can't compute ram drag
C    and hence net thrust
C
      CALL THRUST(POW,ALT,AMACH,GTHRUST)
C
C**********************************************************
C***              Engine sound variable                 ***
C**********************************************************
C
C Scale the engine sound variable for a 20.0 idle value
C
      IF (POW .LE. 50.0) THEN
	   RPMSND = POW / 50.0 * 80.0 + 20.0
      ELSE
	   RPMSND = POW + 50.0
      ENDIF
C
C**********************************************************
C*** Engine forces                                      ***
C**********************************************************
C
      THTL   = THTLN
      PSTL   = PSTLN
C
C     Evaluate sines and cosines of thrust line orientation in body axes.
C
      CTHTL  =  COS(THTL)
      STHTL  =  SIN(THTL)
            :
            :

into either

      REAL A00786,A00787
      REAL A00788,A00789
      REAL A00790,A00791
      REAL TGEAR
      SAVE
      IF (I00727 .EQ. 1) THEN
      A00746=TGEAR(A00730)
      A00743=TGEAR(A00730)
      ENDIF
      A00736=TGEAR(A00730)
      IF (A00729 .GE. 0.5) THEN
      CALL PDOT(A00743,A00736,A00746)
      ELSE
      A00743=A00736
      ENDIF
      CALL THRUST(A00743,A00724,A00725,A00745)
      IF (A00743 .LE. 50.0) THEN
      A00744=A00743/50.0*80.0+20.0
      ELSE
      A00744=A00743+50.0
      ENDIF
      A00786=A00731
      A00765=A00728
      A00751=COS(A00786)
      A00785=SIN(A00786)
            :
            :

removing all comments, but retaining TGEAR and THRUST, or even further to

      REAL A00786,A00787
      REAL A00788,A00789
      REAL A00790,A00791
      REAL A00792
      SAVE
      IF (I00727 .EQ. 1) THEN
      A00746=A00792(A00730)
      A00743=A00792(A00730)
      ENDIF
      A00736=A00792(A00730)
      IF (A00729 .GE. 0.5) THEN
      CALL A00795(A00743,A00736,A00746)
      ELSE
      A00743=A00736
      ENDIF
      CALL A00796(A00743,A00724,A00725,A00745)
      IF (A00743 .LE. 50.0) THEN
      A00744=A00743/50.0*80.0+20.0
      ELSE
      A00744=A00743+50.0
      ENDIF
      A00786=A00731
      A00765=A00728
      A00751=COS(A00786)
      A00785=SIN(A00786)
            :
            :

to retain only Fortran intrinsic definitions.

As one isn’t obliged to push all branches into a remote git repository, development in «clear text» would remain local on infrastructure potentially easier controlled by you. It were up to you to whitelist the access to only those you trust, which obviously can be modular. The public git repository then is constrained to be a show case of results and examples of application of your program.

1 Like

And “is there anybody out there?”
Wikipedia says:

  • Employees 2,500
  • Users 100 million

Does anyone on the other side of the wall will have time to fix our “little” problem?

Someone is discussing the matter here: Please don’t upload my code on GitHub (nogithub.codeberg.page)

(Personally, I have absolutely nothing against github.)

2 Likes

I wonder why are you surprised it’s not easy to contact GitHub staff… you know who owns GitHub, right? Have you seen who answers questions in the forums about their “operating system”?
But that’s not the main reason I am trying to find a way to prevent cloning to GitHub. And like I said I diddn’t start this thread to argue about GitHub. It is what it is, I don’t like it for my own reasons, and I only have an account there because many interesting projects are (sadly) hosted there.

@vmagnin : Did you notice how many times “à notre seule discrétion” or something similar is mentioned in their terms of service?

Code obfuscation proposed by @nbehrnd sounds interesting. It actually reminds me tricks we used in old computers like C64 and Apple ][, just way more sophisticated. But I don’t want to “lock” Free Software that way.

@HugoMVale Thank you very much for the link. I added the “Please don’t upload to GitHub” badge in FORD’s documentation, and will add it to the project’s webpage when I release it.

I didn’t actually know you can’t fork a project in GitHub if it wasn’t there in the first place. However they can always clone it. I have seen projects hosted in SourceForge, the developers flat-out denied moving to GitHub when some users asked (basically demanded) that. And what said users did? They cloned it there despite the fact the developers clearly didn’t want it to happen. That’s exactly what I want to prevent. And like I said it’s not really important for my humble projects that probably nobody would want to clone anyway. It’s more like a general (and ethical, I might add) question.

All I want is a way to tell the user "here is my software, if you like it, use it, fork it, sell it if you can, do whatever you want - just don’t claim you wrote the original software and don’t publish any part of it on GitHub. Several licenses fit for that purpose (LGPL, BSD-3-clause, Zlib etc) except for the last part. I guess something like what @milancurcic suggested is the best I can do.

1 Like

Well, manually you can fork any project, wherever it is, and wherever you want to put it. It can just be more or less simple.

Regarding the original question, adding a sentence in the license text should do, I can’t see any reason why it wouldn’t (especially in the US, where the contract tend to be dominant)

1 Like

I will play the devil’s advocate for the forking part, which is true for many git hosting platforms GitHub, GitLab, BitBucket, etc.

There are a lot of legitimate reasons why one would fork a project, some of them might be superficially interpreted as “no reason, other than having the person who forked being present as a “developer” on that platform”. I will just point out one that is rarely considered.

Forking allows a user to create a snapshot of the codebase and the Git history. Git history can be overwritten; I know of a few cases where a project author, under a permissive open source license, published their project, their project gained popularity and received feedback in the form of bug reports, feature requests and code contributions. Then they proceeded to delete the Git history (and hence the source code), moved everything into a private repository and started selling license keys for access to the compiled binaries. The forks of some random users, that contain zero additional edits, are the only remnants of the original project.


Circling back to the post’s question, yes what you are asking is technically doable but it is somewhat contradictory with the concept of open source (i.e. the use of a modified zlib license), since you are trying to restrict redistribution of a specific kind, which is not based on usage or copyright.

3 Likes