1. Homepage
  2. Programming
  3. [2022] COMP2041/9044 Software Construction - Assignment 1: Tigger

[2022] COMP2041/9044 Software Construction - Assignment 1: Tigger

Engage in a Conversation
COMP2041COMP9044Software ConstructionAssignment 1TiggerShellGITUNSW

Assignment 1: Tigger CourseNana.COM


CourseNana.COM

Introduction CourseNana.COM


CourseNana.COM

CourseNana.COM

Your task in this assignment is to implement Tigger, a subset of the version control system Git. CourseNana.COM

Git is a very complex program that has many individual commands. You will implement only a few of the most important commands. You will also be given a number of simplifying assumptions, which make your task easier. CourseNana.COM

Tigger is a much-loved children's book character known for getting Git commands backwards. CourseNana.COM

You must implement Tigger in Shell. CourseNana.COM

Interestingly, early versions of Git made heavy use of Shell and Perl. CourseNana.COM


CourseNana.COM

Reference implementation CourseNana.COM

Many aspects of this assignment are not fully specified in this document; instead, you must match the behaviour of a reference implementation. CourseNana.COM

For example, your script tigger-add should match the behaviour of 2041 tigger-add exactly, including producing the same error messages. CourseNana.COM

Provision of a reference implementation is a common method to provide or define an operational specification, and it's something you will likely need to do after you leave UNSW. CourseNana.COM

Discovering and matching the reference implementation's behaviour is deliberately part of the assignment. CourseNana.COM

While the code in the reference implementation is fairly straightforward, reverse-engineering its behaviour is obviously not so simple, and is a nice example of how coming to grips with the precise semantics of an apparently obvious task can still be challenging. CourseNana.COM

If you discover what you believe to be a bug in the reference implementation, report it in the class forum. We may fix the bug, or indicate that you do not need to match the reference implementation's behaviour in this case. CourseNana.COM


CourseNana.COM

Tigger Commands CourseNana.COM

Subset 0 CourseNana.COM

Subset 0 commands must be implemented in POSIX-compatible Shell. See the Permitted Languages section for more information. CourseNana.COM

tigger-init CourseNana.COM

The tigger-init command creates an empty Tigger repository. CourseNana.COM

tigger-init should create a directory named .tigger, which it will use to store the repository. It should produce an error message if this directory already exists. CourseNana.COM

You should match this, and other error messages exactly. For example: CourseNana.COM

ls -d .tigger CourseNana.COM

ls: cannot access .tigger: No such file or directory CourseNana.COM

./tigger-init CourseNana.COM

Initialized empty tigger repository in .tigger CourseNana.COM

ls -d .tigger CourseNana.COM

.tigger CourseNana.COM

./tigger-init CourseNana.COM

./tigger-init: error: .tigger already exists CourseNana.COM

tigger-init may create initial files or directories inside .tigger. CourseNana.COM

You do not have to use a particular representation to store the repository. CourseNana.COM

You do not have to create the same files or directories inside .tigger as the reference implementation. You can create whatever files or directories inside .tigger you wish. CourseNana.COM

Do not store information outside .tigger CourseNana.COM

tigger-add filenames... CourseNana.COM

The tigger-add command adds the contents of one or more files to the index. CourseNana.COM

Files are added to the repository in a two-step process. The first step is adding them to the index. CourseNana.COM

You will need to store files in the index somehow in the .tigger sub-directory. For example, you might choose store them in a sub-directory of .tigger. CourseNana.COM

Only ordinary files in the current directory can be added. You can assume filenames start with an alphanumeric character ([a-zA-Z0-9]) and will only contain alpha-numeric characters, plus '.', '-' and '_' characters. CourseNana.COM

The tigger-add command, and other Tigger commands, will not be given pathnames with slashes. CourseNana.COM

tigger-commit -m message CourseNana.COM

The tigger-commit command saves a copy of all files in the index to the repository. CourseNana.COM

A message describing the commit must be included as part of the commit command. CourseNana.COM

Tigger commits are numbered sequentially: they are not hashes, like Git. You must match the numbering scheme. CourseNana.COM

You can assume the commit message is ASCII, does not contain new-line characters, and does not start with a '-' character. CourseNana.COM

tigger-log CourseNana.COM

The tigger-log command prints a line for every commit made to the repository: each line should contain the commit number and the commit message. CourseNana.COM

tigger-show [commit]:filename CourseNana.COM

The tigger-show should print the contents of the specified filename as of the specified commit. If commit is omitted, the contents of the file in the index should be printed. CourseNana.COM

You can assume the commit if specified will be a non-negative integer. CourseNana.COM

For example: CourseNana.COM

./tigger-init CourseNana.COM

Initialized empty tigger repository in .tigger CourseNana.COM

echo line 1 > a CourseNana.COM

echo hello world >b CourseNana.COM

./tigger-add a b CourseNana.COM

./tigger-commit -m 'first commit' CourseNana.COM

Committed as commit 0 CourseNana.COM

echo  line 2 >>a CourseNana.COM

./tigger-add a CourseNana.COM

./tigger-commit -m 'second commit' CourseNana.COM

Committed as commit 1 CourseNana.COM

./tigger-log CourseNana.COM

1 second commit CourseNana.COM

0 first commit CourseNana.COM

echo line 3 >>a CourseNana.COM

  CourseNana.COM

Subset 1 CourseNana.COM

Subset 1 is more difficult. You will need to spend some time understanding the semantics (meaning) of these operations, by running the reference implementation, or researching the equivalent Git operations. CourseNana.COM

Note the assessment scheme recognises this difficulty. CourseNana.COM

Subset 1 commands must be implemented in POSIX-compatible Shell. See the Permitted Languages section for more information. CourseNana.COM

tigger-commit [-a] -m message CourseNana.COM

tigger-commit can have a -a option, which causes all files already in the index to have their contents from the current directory added to the index before the commit. CourseNana.COM

tigger-rm [--force] [--cached] filenames... CourseNana.COM

tigger-rm removes a file from the index, or from the current directory and the index. CourseNana.COM

If the --cached option is specified, the file is removed only from the index, and not from the current directory. CourseNana.COM

tigger-rm, like git rm, should stop the user accidentally losing work, and should give an error message instead if the removal would cause the user to lose work. You will need to experiment with the reference implementation to discover these error messages. Researching git rm's behaviour may also help. CourseNana.COM

The --force option overrides this, and will carry out the removal even if the user will lose work. CourseNana.COM

tigger-status CourseNana.COM

tigger-status shows the status of files in the current directory, the index, and the repository. CourseNana.COM

./tigger-init CourseNana.COM

Initialized empty tigger repository in .tigger CourseNana.COM

touch a b c d e f g h CourseNana.COM

./tigger-add a b c d e f CourseNana.COM

./tigger-commit -m 'first commit' CourseNana.COM

Committed as commit 0 CourseNana.COM

echo hello >a CourseNana.COM

echo hello >b CourseNana.COM

echo hello >c CourseNana.COM

./tigger-add a b CourseNana.COM

echo world >a CourseNana.COM

rm d CourseNana.COM

  CourseNana.COM

Subset 2 CourseNana.COM

Subset 2 is extremely difficult. You will need to spend considerable time understanding the semantics of these operations, by running the reference implementation, and/or researching the equivalent Git operations. CourseNana.COM

Note the assessment scheme recognises this difficulty. CourseNana.COM

Subset 2 commands must be implemented in POSIX-compatible Shell. See the Permitted Languages section for more information. CourseNana.COM

tigger-branch [-d] [branch-name] CourseNana.COM

tigger-branch either creates a branch, deletes a branch, or lists current branch names. CourseNana.COM

tigger-checkout branch-name CourseNana.COM

tigger-checkout switches branches. CourseNana.COM

Note that, unlike Git, you can not specify a commit or a file: you can only specify a branch. CourseNana.COM

tigger-merge (branch-name|commit) -m message CourseNana.COM

tigger-merge adds the changes that have been made to the specified branch or commit to the index, and commits them. CourseNana.COM

./tigger-init CourseNana.COM

Initialized empty tigger repository in .tigger CourseNana.COM

seq 1 7 >7.txt CourseNana.COM

./tigger-add 7.txt CourseNana.COM

./tigger-commit -m commit-1 CourseNana.COM

Committed as commit 0 CourseNana.COM

./tigger-branch b1 CourseNana.COM

./tigger-checkout b1 CourseNana.COM

Switched to branch 'b1' CourseNana.COM

perl -pi -e 's/2/42/' 7.txt CourseNana.COM

cat 7.txt CourseNana.COM

1 CourseNana.COM

42 CourseNana.COM

3 CourseNana.COM

4 CourseNana.COM

5 CourseNana.COM

6 CourseNana.COM

7 CourseNana.COM

If a file has been changed in both branches tigger-merge produces an error message. CourseNana.COM

Note: if a file has been changed in both branches git examines which lines have been changed and combines the changes if possible. Tigger doe not do this, for example: CourseNana.COM

./tigger-init CourseNana.COM

Initialized empty tigger repository in .tigger CourseNana.COM

seq 1 7 >7.txt CourseNana.COM

./tigger-add 7.txt CourseNana.COM

./tigger-commit -m commit-1 CourseNana.COM

Committed as commit 0 CourseNana.COM

./tigger-branch b1 CourseNana.COM

./tigger-checkout b1 CourseNana.COM

Switched to branch 'b1' CourseNana.COM

perl -pi -e 's/2/42/' 7.txt CourseNana.COM

cat 7.txt CourseNana.COM

1 CourseNana.COM

42 CourseNana.COM

3 CourseNana.COM

4 CourseNana.COM

5 CourseNana.COM

6 CourseNana.COM

7 CourseNana.COM

./tigger-commit -a -m commit-2 CourseNana.COM

Committed as commit 1 CourseNana.COM


CourseNana.COM

Testing CourseNana.COM

Autotests CourseNana.COM

As usual, some autotests will be available: CourseNana.COM

2041 autotest tigger tigger-* CourseNana.COM

... CourseNana.COM

You can also run only tests for a particular subset or an individual test: CourseNana.COM

2041 autotest tigger subset1 tigger-* CourseNana.COM

... CourseNana.COM

2041 autotest tigger subset1_13 tigger-* CourseNana.COM

... CourseNana.COM

If you are using extra Shell files, include them on the autotest command line. CourseNana.COM

Autotest and automarking will run your scripts with a current working directory different to the directory containing the script. The directory containing your submission will be in $PATH. CourseNana.COM

You will need to do most of the testing yourself. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
COMP2041代写,COMP9044代写,Software Construction代写,Assignment 1代写,Tigger代写,Shell代写,GIT代写,UNSW代写,COMP2041代编,COMP9044代编,Software Construction代编,Assignment 1代编,Tigger代编,Shell代编,GIT代编,UNSW代编,COMP2041代考,COMP9044代考,Software Construction代考,Assignment 1代考,Tigger代考,Shell代考,GIT代考,UNSW代考,COMP2041help,COMP9044help,Software Constructionhelp,Assignment 1help,Tiggerhelp,Shellhelp,GIThelp,UNSWhelp,COMP2041作业代写,COMP9044作业代写,Software Construction作业代写,Assignment 1作业代写,Tigger作业代写,Shell作业代写,GIT作业代写,UNSW作业代写,COMP2041编程代写,COMP9044编程代写,Software Construction编程代写,Assignment 1编程代写,Tigger编程代写,Shell编程代写,GIT编程代写,UNSW编程代写,COMP2041programming help,COMP9044programming help,Software Constructionprogramming help,Assignment 1programming help,Tiggerprogramming help,Shellprogramming help,GITprogramming help,UNSWprogramming help,COMP2041assignment help,COMP9044assignment help,Software Constructionassignment help,Assignment 1assignment help,Tiggerassignment help,Shellassignment help,GITassignment help,UNSWassignment help,COMP2041solution,COMP9044solution,Software Constructionsolution,Assignment 1solution,Tiggersolution,Shellsolution,GITsolution,UNSWsolution,