r-tamura / building-git-typescript Goto Github PK
View Code? Open in Web Editor NEWA toy implementation of Git in TypeScript
A toy implementation of Git in TypeScript
$ kit init
$ echo "one" > 1.txt
$ git add 1.txt
$ GIT_AUTHOR_NAME=auuu GIT_AUTHOR_EMAIL='[email protected]' kit commit
first <-- ctrl + D
[(root-commit) be4baaf73007190adc5cca1c1cefa7b666dc0bcb]
# git, not kit
$ git log
displays date time proeprly.
commit be4baaf73007190adc5cca1c1cefa7b666dc0bcb (HEAD -> master)
Author: auuu <[email protected]>
Date: Thr May 28 22:59:29 2020 +0900
commit be4baaf73007190adc5cca1c1cefa7b666dc0bcb (HEAD -> master)
Author: auuu <[email protected]>
Date: Thu Jan 1 00:00:00 1970 +0000
jit log
fatal: invalid date or strptime format - `1590674369.157 +0900' `%s %z'
エラーが発生したときにTypeScriptファイルソースコード位置を出力するように
How to reproduce the issue
Welcome to Node.js v14.0.0.
Type ".help" for more information.
> const Index = require("./src/gindex")
undefined
> const index = new Index(".git/index")
Uncaught TypeError: Index is not a constructor
> const ind = new Index.Index(".git/index")
undefined
> ind
Index {}
> ind.load()
Promise { <pending> }
> (node:60923) UnhandledPromiseRejectionWarning: Invalid: Checksum does not match value stored on disk
at Checksum.<anonymous> (/Users/r-tamura/Documents/work/lab/git-internal/src/gindex/checksum.js:63:23)
at Generator.next (<anonymous>)
at fulfilled (/Users/r-tamura/Documents/work/lab/git-internal/src/gindex/checksum.js:5:58)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:60923) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:60923) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
> process.exit()
kit init
echo '1.txt' > f.txt
kit add .
kit init
kit add f.txt
kit commit -m "A"
echo '2' > g.txt
kit add g.txt
kit commit -m "B"
kit checkout master^
kit branch topic
kit checkout topic
echo '3' > g.txt
kit add g.txt
kit commit -m "C"
kit checkout master
kit merge topic -m "M"
kit status
no changes added to commit
nothing to commit, working tree clean
merge.test.ts > conflicted merge: file/directory addition > puts a namespaced copy of the conflicted file in the workspace
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.