Skip to content

Commit

Permalink
Change on review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
BaoCaiH committed Apr 26, 2024
1 parent 16e9f82 commit 44c32f4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions diff-advance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ Run `source setup.sh` or `bash setup.sh` or `./setup.sh` (or `.\setup.ps1` in Po
3. Compare `git diff master pipeline-improvement` and `git diff pipeline-improvement master`. Notice what is being removed and added.
4. Include `--word-diff` with `git diff`. In addition to the default, word diff can also be used in different modes, i.e. `--word-diff=color`. See how it is different from normal diff.
5. Include `--name-only` option with `git diff` and see the result.
6. With `--name-only`, we get a list of changed files. This can be useful for example when we want to do selective compile/test of changed files instead of a full re-build, given that steps can be compiled/tested independently. In our exercise, there are 3 steps in a pipeline and a utilities file. Let's say we only want to test the pipelines because we're confident enough with the utils to not test them (naughty-list programmer). We can do something like this:
6. With `--name-only`, we get a list of changed files. This can be useful for example when we want to do selective compile/test of changed files instead of a full re-build, given that steps can be compiled/tested independently. In our exercise, there are 3 steps in a pipeline and an utilities file. Let's say we only want to test the pipelines because we're confident enough with the utils to not test them (naughty-list programmer). We can do something like this:

`git diff --name-only | grep .pipeline | xargs cat`
`git diff --name-only | grep '.pipeline' | xargs cat`

This will:
1. Get a list of the changed files
2. Filter for only `.pipeline` files
3. `cat`/test only these files
3. `cat`/test these files

## Relevant commands and options

- `git diff`
- `--word-diff`
- `--name-only`
- `grep`
- `xargs`
- `xargs`

0 comments on commit 44c32f4

Please sign in to comment.