Skip to content

Latest commit

 

History

History

microtask3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

1.What is the meaning of the JSON attribute 'timestamp'?
The attribute 'timestamp' gives the date and time of the moment when the JSON item got generated. Timestamp is in 'epoch' format which can be converted into date and time.

2.What is the meaning of the JSON attribute 'updated_on'?
This attribute shows the date and time of when was the item(repo) got last updated.

3.What is the meaning of the JSON attribute 'origin'?
It shows the link of from where the information is fetched i.e. the link of data source. It usually shows the git repo link when data source is github.

4.What is the meaning of the JSON attribute 'category'?
It shows what type of information been fetched from the source. If source is git then category is a commit operation and if source is github or something they can have some other categories as well like pull, repo stats, issues, etc.

5.What is the meaning of the JSON attribute 'uuid'?
It is a 128 bit unique number given to that operation. It is usually universally unique. Here uuid is used to identify the items generated by Perceval in a unique way.

6.Which are the common methods of the Perceval backends?
Common methods of perceval backends are:

  • fetch() :
    syntax : fetch(self, category=CATEGORY_COMMIT, from_date=DEFAULT_DATETIME, to_date=DEFAULT_LAST_DATETIME, branches=None, latest_items=False, no_update=False)

    The method retrieves from a Git repository or a log file a list of commits. Commits are returned in the same order they were obtained.
    :param category: the category of items to fetch
    :param from_date: obtain commits newer than a specific date (inclusive)
    :param to_date: obtain commits older than a specific date
    :param branches: names of branches to fetch from (default: None)
    :param latest_items: sync with the repository to fetch only the newest commits
    :param no_update: if enabled, don't update the repo with the latest changes
    :returns: a generator of commits.


  • has_archiving() :
    syntax : has_archiving(cls)

    Returns whether it supports archiving items on the fetch process.
    :returns: this backend does not support items archive

  • has_resuming() :
    syntax : has_resuming(cls)

    Returns whether it supports to resume the fetch process.
    :returns: this backend supports items resuming

  • metadata_id():
    syntax : metadata_id(item)

    Extracts the identifier from a Git item.


7.List and explain at least 3 Git commands used by the Perceval backend (you can rely on the Git documentation)
Git commands used by Perceval backend are :

  • clone() :
    syntax : clone(cls, uri, dirpath)
    This method clones the repo. Make a bare copy of the repository stored in uri into dirpath. The repository would be either local or remote.
    :param uri: URI of the repository
    :param dirtpath: directory where the repository will be cloned
    :returns: a GitRepository class having cloned the repository

  • count_objects():
    syntax : count_objects(self)
    Count the objects of a repository. The method returns the total number of objects (packed and unpacked) available on the repository

  • update() :
    syntax : update(self)
    Update repository from its remote. Calling this method, the repository will be synchronized with the remote repository using 'fetch' command for 'heads' refs. Any commit stored in the local copy will be removed; refs will be overwritten.

  • sync() :
    syntax : sync(self)
    Keep the repository in sync. This method will synchronize the repository with its 'origin', fetching newest objects and updating references. It uses low level commands which allow to keep track of which things have changed in the repository. The method also returns a list of hashes related to the new commits fetched during the process. It returns a list of new commits