# Credit Where Credit Is Due

**URL:** <https://forums.swift.org/t/credit-where-credit-is-due/11783>\
**Category:** Site Feedback\
**Created:** [April 9, 2018, 7:28am UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783 "2018-04-09T07:28:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![palimondo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/palimondo/32/1144_2.png) [@palimondo](https://forums.swift.org/u/palimondo)\
**Post date:** [April 9, 2018, 7:28am UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/1 "2018-04-09T07:28:44Z")

</div>

Every source file in the Swift project contains license and copyright preamble that says:

> See [https://swift.org/CONTRIBUTORS.txt](https://swift.org/CONTRIBUTORS.txt) for the list of Swift project authors

That file claims that it is automatically generated:

> ### Auto-populated List
> 
> Names below this line are automatically generated from the repository logs. It contains the information about the committer that was publicly present when the commit was made.

But it appears that the process that maintains the contributors list isn’t automated and wasn’t executed for several years: `CONTRIBUTORS.txt` contains **221** individuals (including duplicates), whereas the GitHub says that [Swift project](https://github.com/apple/swift) has **581** [contributors](https://github.com/apple/swift/graphs/contributors).

Can this process be automated, or at least executed regularly, and update the list of contributors to reflect all the hard work the community has poured in?

---

<div class="post-metadata">

**Author:** ![Nicole\_Jacque](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nicole_jacque/32/245_2.png) [@Nicole\_Jacque](https://forums.swift.org/u/Nicole_Jacque)\
**Post date:** [April 9, 2018, 5:03pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/2 "2018-04-09T17:03:53Z")

</div>

I will look into what the state of the automation is.

---

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [April 11, 2018, 3:01pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/3 "2018-04-11T15:01:19Z")

</div>

The CONTRIBUTORS file is something I was going to suggest we remove because it has problems being kept up-to-date and that all this information can be queried from GitHub. Before we made that switch I wanted to make sure the affordances provided by GutHub are adequate so that we don’t have the same problem of not appropriately crediting people. It’s been on my list of TODOs.

---

<div class="post-metadata">

**Author:** ![palimondo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/palimondo/32/1144_2.png) [@palimondo](https://forums.swift.org/u/palimondo)\
**Post date:** [April 11, 2018, 3:40pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/4 "2018-04-11T15:40:19Z")

</div>

Does that mean we’ll update the file preamble to link to the Github for copyright purposes?

---

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [April 11, 2018, 4:33pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/5 "2018-04-11T16:33:09Z")

</div>

> [@palimondo](#):
>
> Does that mean we’ll update the file preamble to link to the Github for copyright purposes?

Yes, and everywhere else that references that file... assuming we deem that adequate for serving the same purpose that ostensibly the CONTRIBUTORS file serves.

---

<div class="post-metadata">

**Author:** ![palimondo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/palimondo/32/1144_2.png) [@palimondo](https://forums.swift.org/u/palimondo)\
**Post date:** [April 11, 2018, 8:05pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/6 "2018-04-11T20:05:25Z")

</div>

Well, I for one, don’t know how to get more than the list of top100 contributors from that [github listing](https://github.com/apple/swift/graphs/contributors), and that doesn’t seem sufficient from copyright perspective… maybe someone from legal should have a look at that, too?

---

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [April 11, 2018, 8:06pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/7 "2018-04-11T20:06:29Z")

</div>

> [@palimondo](#):
>
> Well, I for one, don’t know how to get more than the list of top100 contributors from that github listing , and that doesn’t seem sufficient from copyright perspective… maybe someone from legal should have a look at that, too?

Yeah, this is my concern. If GitHub does not have a good way to do what we need we will keep the CONTRIBUTORS file.

---

<div class="post-metadata">

**Author:** ![rudkx](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/rudkx/32/20610_2.png) [@rudkx](https://forums.swift.org/u/rudkx)\
**Post date:** [April 12, 2018, 12:43am UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/8 "2018-04-12T00:43:15Z")

</div>

> [@palimondo](#):
>
> Well, I for one, don’t know how to get more than the list of top100 contributors from that github listing...

You can use 'shortlog' in git to list everyone that has made a contribution via git, e.g.:

```swift
git shortlog -s -e --no-merges

```

We could introduce a `.mailmap` file as well to clean up this output for people that have contributed under multiple email addresses but only want a single current canonical one to show up in the output.

---

<div class="post-metadata">

**Author:** ![nnnnnnnn](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nnnnnnnn/32/264_2.png) [@nnnnnnnn](https://forums.swift.org/u/nnnnnnnn)\
**Post date:** [April 12, 2018, 3:53pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/9 "2018-04-12T15:53:19Z")

</div>

That's super cool—I'd not seen a `.mailmap` file before! I took a crack at creating one, using a best guess at consolidating email addresses, in which I've probably made some mistakes:

[https://github.com/apple/swift/compare/master...natecook1000:add-mailmap](https://github.com/apple/swift/compare/master...natecook1000:add-mailmap)

With that in place, generating the list with the command below produces 653 names instead of the default 795:

```swift
git shortlog -s -e --no-merges | cut -f 2 | sed -E 's/^/- /' | sort -f

```

I really like that people could simply update that file to switch their own contact/name information.

---

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [April 16, 2018, 5:08pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/10 "2018-04-16T17:08:00Z")

</div>

> [@nnnnnnnn](#):
>
> That’s super cool—I’d not seen a .mailmap file before! I took a crack at creating one, using a best guess at consolidating email addresses, in which I’ve probably made some mistakes

@nnnnnnnn This looks great. Can you create a pull request? I've noticed a few cases of replicated names (e.g., "Dave Abrahams" is listed on 4 consecutive rows). I think adding this would be great.

> [@nnnnnnnn](#):
>
> ```shell
> git shortlog -s -e --no-merges | cut -f 2 | sed -E 's/^/- /' | sort -f
> 
> ```

This also looks great. I'd be happy to use this to update the CONTRIBUTORS file, once we have a good `mailmap` landed.

---

<div class="post-metadata">

**Author:** ![nnnnnnnn](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nnnnnnnn/32/264_2.png) [@nnnnnnnn](https://forums.swift.org/u/nnnnnnnn)\
**Post date:** [April 16, 2018, 8:51pm UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/11 "2018-04-16T20:51:14Z")

</div>

Yep! PR here: [Add .mailmap file to merge email addresses in git shortlog by natecook1000 · Pull Request #15958 · apple/swift · GitHub](https://github.com/apple/swift/pull/15958)

---

<div class="post-metadata">

**Author:** ![DaveZ](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/davez/32/478_2.png) [@DaveZ](https://forums.swift.org/u/DaveZ)\
**Post date:** [April 19, 2018, 11:28am UTC](https://forums.swift.org/t/credit-where-credit-is-due/11783/12 "2018-04-19T11:28:09Z")

</div>

Neat-o!

FYI – If one always wants to use the mailmap with log-like operations (including `git blame`), then set `log.mailmap` to `true` in the desired git configuration file. For example, to change `~/.gitconfig`, one can run `git config --global log.mailmap true`
