02-Assignment 1: Pushy 作业详解一Subset 1(unsw作业-COMP(2041|9044) - 24T1)新南威尔士大学UNSW课程作业指导

本文详细解析了新南威尔士大学UNSW课程COMP2041|9044的Assignment 1:Pushy,涵盖pushy-commit、pushy-rm、pushy-status三个Shell命令的实现要求和功能。pushy-commit新增-a选项,pushy-rm支持--force和--cached选项,pushy-status需展示文件在目录、索引和仓库的状态。文章提供了命令行为分析及实现思路。
摘要由CSDN通过智能技术生成

COMP(2041|9044) 24T1 — Assignment 1: Pushy

Subset 1 原题:

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.

Note the assessment scheme recognises this difficulty.

Subset 1 commands must be implemented in POSIX-compatible Shell.

See the Permitted Languages section for more information.

pushy-commit [-a] -m message

pushy-commit can now 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.

pushy-rm [--force] [--cached] filenames...

pushy-rm removes a file from the index, or, from the current directory and the index.

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

pushy-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.

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

pushy-status

pushy-status shows the status of files in the current directory, the index, and the repository.

There are many different cases to consider for pushy-status.
You will need to experiment with the reference implementation to find them all.

Subset 1 原题讲解:

这个题目要求你实现一套基于 Shell 的版本控制命令,与 Git 类似,但功能更为简化。这套命令包括 pushy-commitpushy-rm 和 pushy-status,要求在一个 POSIX 兼容的 Shell 环境中实现。让我们逐一分析这些命令的要求和功能。

pushy-commit

这个命令用于提交当前在索引(index)中的更改。

  • 这个命令有一个新的选项 -a,当这个选项被使用时,它会先将当前目录中,所有已经在索引中的文件的最新内容添加到索引。
  • 必须要有 -m
  • 34
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值