35 lines
1.8 KiB
Markdown
35 lines
1.8 KiB
Markdown
|
# TeamCity support for Gitea - Test Task
|
||
|
|
||
|
This is a small project to implement a subset of git's functionality in Kotlin and was created using the instructions
|
||
|
below as part of my application to the JetBrains internship project "TeamCity support for Gitea".
|
||
|
|
||
|
## Assumptions
|
||
|
|
||
|
Since this is an internship application project, I have assumed that a minimal usage of external libraries is preferred,
|
||
|
so that a greater technical understanding can be demonstrated.
|
||
|
|
||
|
## Instructions
|
||
|
|
||
|
Create a library that implements simple Git functionality. You need to implement at least three entities:
|
||
|
- `Blob` will contain some data, which for the sake of simplicity, will be represented as a string. Additionally, it
|
||
|
will store a SHA-1 hash* that uniquely identifies the blob;
|
||
|
- `Tree` will function as a container for a collection of named blobs or other trees. It will also have a SHA-1 hash
|
||
|
that uniquely identifies the tree;
|
||
|
- `Commit` will serve as a pointer to the main `Tree` object and store metadata related to the commit. This metadata
|
||
|
will include the author of the commit, the commit message, the commit time, and the SHA-1 hash of the commit itself.
|
||
|
Commits should be stored chronologically so that their relationship can be tracked.
|
||
|
|
||
|
Your implementation should avoid stored data redundancy like real Git does.
|
||
|
The implementation does **not** need to include persistence functionality, which refers to the ability to store data
|
||
|
using the library in previous runs.
|
||
|
|
||
|
The library you implement should be able to:
|
||
|
- Create new commits;
|
||
|
- List commits;
|
||
|
- Search for specific commit by hash or metadata and print its content.
|
||
|
|
||
|
You should use Java or Kotlin for your implementation.
|
||
|
It would be highly beneficial to implement tests for basic usage scenarios and corner cases.
|
||
|
|
||
|
**SHA-1 hash is a cryptographic hash function that calculates a unique fixed-size output based on the input data*
|