Skip to content

Repository creation date #2526

Closed
Closed

Description

@Androz2091

It would be nice if we could have a quick access to the repository creation date (to know if it's a recent or an old project).

Example URL:

github.com/user/repo

Activity

  1. sindresorhus commented on Nov 10, 2019

    @sindresorhus
    Member

    I sometimes needed this too. Where should it be shown if so?

  2. yakov116 commented on Nov 10, 2019

    @yakov116
    Member

    @sindresorhus under the repo name

  3. sindresorhus commented on Nov 10, 2019

    @sindresorhus
    Member

    @yakov116 I disagree. It's not important enough to clutter up that area. It should be in a more subtle place.

  4. fregante commented on Nov 10, 2019

    @fregante
    Member

    I sometimes needed this too. Where should it be shown if so?

    This should be possible with this query, but for some reason it requires a before cursor.

    {
      repository(owner: "sindresorhus", name: "refined-github") {
        defaultBranchRef {
          target {
            ... on Commit {
              history(last: 1) {
                nodes {
                  committedDate
                }
              }
            }
          }
        }
      }
    }

    history(first: 1) works without any other parameter (but it's the latest commit, not the first)

    Otherwise we have to use the REST API and still use 2 queries. The first one includes a link to the last page, which will include the first commit.

  5. Androz2091 commented on Nov 13, 2019

    @Androz2091
    Author

    I don't know how the extension works, it was just a suggestion that I can't make myself but I see a created_at property when I use the REST API to get repository informations (for example https://api.github.com/repos/Androz2091/AtlantaBot) with only one query. Wouldn't it be better to use that?

    Edit: Knowing that the first commit is not necessarily equal to the date of creation of the project, right?

  6. added
    small
    and removed on Nov 13, 2019
  7. fregante commented on Nov 13, 2019

    @fregante
    Member

    I see a created_at property when I use the REST API

    D'oh. Indeed. It should be pretty easy to implement then. Ideally this information should be found on the GraphQL API though; Only as a last resort we should use the REST API.

    Knowing that the first commit is not necessarily equal to the date of creation of the project, right?

    Technically I'd say that the first commit is the birth of the project. I think created_at is the time you created a GitHub repo but one could create a GitHub repo long after starting work locally.

    However this is kind of a nitpick so created_at should be good enough.

  8. yakov116 commented on Nov 13, 2019

    @yakov116
    Member

    @fregante

    {
      repository(owner: "sindresorhus", name: "refined-github") {
        createdAt
      }
    }

    =>

    {
      "data": {
        "repository": {
          "createdAt": "2016-02-15T16:45:02Z"
        }
      }
    }
  9. maxmclau commented on Nov 19, 2019

    @maxmclau
    Contributor

    I like the idea of this, I'm going to give adding it a shot. Does anyone have issues with @fregante's idea of adding it to the stats/number's bar?

  10. maxmclau commented on Nov 20, 2019

    @maxmclau
    Contributor

    Screen Shot 2019-11-20 at 5 16 48 PM

    This is using the repo's created at value, but I'd like to base it off the time of first commit as discussed

  11. Androz2091 commented on Nov 20, 2019

    @Androz2091
    Author

    Wow, that's awesome. Personally, the date of creation of the repository is perfect for me.

  12. fregante commented on Nov 20, 2019

    @fregante
    Member

    This is using the repo's created at value, but I'd like to base it off the time of first commit as discussed

    As long as it can be determined in one HTTP request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedenhancementsmall

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions