# Code reuse

4 messages from 2009-10-06 to 2009-10-07. Participants: Philip Herron, Sitaram Chamarty, Florian Weimer.
Thread: https://gitlist.dev/t/21142

## Philip Herron, 2009-10-06 19:18

Subject: Code reuse
Message-ID: <ac07bcaf0910061218x148374d0u66b36fae1466ea98@mail.gmail.com>
URL: https://gitlist.dev/e/ac07bcaf0910061218x148374d0u66b36fae1466ea98%40mail.gmail.com

```
Hey guys

I am not sure if this is the right place to ask this question, but
I've been working on a personal project a programming language
interpreter for some time now, but i took 2 code snippets from
git-core namely:

static struct hash_table_entry *lookup_hash_entry(unsigned int hash,
const struct hash_table *table)

function from hash.c and the alloc_nr.

I've changed it a good bit (probably doesn't resemble much of what it
was) to fit in with the way my stuff works but is there anything i
need to like put in my source code to say hey this is based of
git-core, so far is just a comment to say 'based of git-core hash.c'.
Its an open source (GPL) program but i haven't released or made much
noise about it yet because i want to work on it more myself.

Anyways thanks,

--Phil

```

## Sitaram Chamarty, 2009-10-07 12:30

Subject: Re: Code reuse
Message-ID: <2e24e5b90910070530p757b3651ne0f7e4a6e8bc8825@mail.gmail.com>
URL: https://gitlist.dev/e/2e24e5b90910070530p757b3651ne0f7e4a6e8bc8825%40mail.gmail.com
In-Reply-To: <ac07bcaf0910061218x148374d0u66b36fae1466ea98@mail.gmail.com>

```
On Wed, Oct 7, 2009 at 12:48 AM, Philip Herron
<herron.philip@googlemail.com> wrote:

> I am not sure if this is the right place to ask this question, but
> I've been working on a personal project a programming language
> interpreter for some time now, but i took 2 code snippets from
> git-core namely:

[snip]

> I've changed it a good bit (probably doesn't resemble much of what it
> was) to fit in with the way my stuff works but is there anything i
> need to like put in my source code to say hey this is based of
> git-core, so far is just a comment to say 'based of git-core hash.c'.
> Its an open source (GPL) program but i haven't released or made much
> noise about it yet because i want to work on it more myself.

In general, the GPL's main requirement is that whoever gets the binary
should also get the code (I'm over simplifying but that's basically
it).  It actually doesn't say much about giving credit, except (from
<HEAD:COPYING>):

"If the software is modified by someone else and passed on, we want
its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the
original authors' reputations"

and

"a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change."

That's basically it...

It would seem to me that, if you changed them significantly, and going
by the above logic, you don't need to do *anything* regarding
attribution.

```

## Philip Herron, 2009-10-07 20:12

Subject: Re: Code reuse
Message-ID: <ac07bcaf0910071312u13be3b32p8afd956c80e4014a@mail.gmail.com>
URL: https://gitlist.dev/e/ac07bcaf0910071312u13be3b32p8afd956c80e4014a%40mail.gmail.com
In-Reply-To: <2e24e5b90910070530p757b3651ne0f7e4a6e8bc8825@mail.gmail.com>

```
Thanks for that i am no legalese speaker so yeah ;). Its only really
the alloc_nr but its renamed is nearly the same the other really isnt
the same only just 2 statements with different identifiers remain.

Thanks anyways git-core is nice :)

--Phil

2009/10/7 Sitaram Chamarty <sitaramc@gmail.com>:
> On Wed, Oct 7, 2009 at 12:48 AM, Philip Herron
> <herron.philip@googlemail.com> wrote:
>
>> I am not sure if this is the right place to ask this question, but
>> I've been working on a personal project a programming language
>> interpreter for some time now, but i took 2 code snippets from
>> git-core namely:
>
> [snip]
>
>> I've changed it a good bit (probably doesn't resemble much of what it
>> was) to fit in with the way my stuff works but is there anything i
>> need to like put in my source code to say hey this is based of
>> git-core, so far is just a comment to say 'based of git-core hash.c'.
>> Its an open source (GPL) program but i haven't released or made much
>> noise about it yet because i want to work on it more myself.
>
> In general, the GPL's main requirement is that whoever gets the binary
> should also get the code (I'm over simplifying but that's basically
> it).  It actually doesn't say much about giving credit, except (from
> <HEAD:COPYING>):
>
> "If the software is modified by someone else and passed on, we want
> its recipients to know that what they have is not the original, so
> that any problems introduced by others will not reflect on the
> original authors' reputations"
>
> and
>
> "a) You must cause the modified files to carry prominent notices
> stating that you changed the files and the date of any change."
>
> That's basically it...
>
> It would seem to me that, if you changed them significantly, and going
> by the above logic, you don't need to do *anything* regarding
> attribution.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

```

## Florian Weimer, 2009-10-07 20:15

Subject: Re: Code reuse
Message-ID: <87hbub3qr9.fsf@mid.deneb.enyo.de>
URL: https://gitlist.dev/e/87hbub3qr9.fsf%40mid.deneb.enyo.de
In-Reply-To: <2e24e5b90910070530p757b3651ne0f7e4a6e8bc8825@mail.gmail.com>

```
* Sitaram Chamarty:

> It would seem to me that, if you changed them significantly, and going
> by the above logic, you don't need to do *anything* regarding
> attribution.

Note that applicable laws may impose additional restrictions, like
crediting authors in the way they require.

My personal approach is to include the copyright header of the file
I'm quoting from, together with a comment which explains where the
code came from (project, version, path).

```
