# See which features changed after git pull, with FACET

> After each pull, list the features whose code changed while their FACET description did not, read only those diffs, and mark what you have reviewed so the next pull shows only what is new.

Source: https://facet-framework.com/en/guides/see-what-changed-after-pull/  
Last updated: 2026-11-26T23:28:23+01:00

Monday morning, back from two weeks off. `git pull` brings in forty commits from five people. Somewhere in there, someone may have changed how the feature you are responsible for behaves, and the commit messages say "fix", "cleanup" and "address review". Reading every diff takes the morning; skipping them means you find out from a customer.

FACET keeps a short, checkable description of each feature, called a record, next to your code and links the two with a comment in the code. By the end of this guide one command after each pull tells you which of your documented features had their code changed underneath them, and which records may now be wrong. `facet drift` compares the code with a baseline you choose, and `facet drift accept` remembers what you have already reviewed, so the next pull only shows what is new.

The commands below use a small example shop written in TypeScript, set up as in [One answer instead of three](https://facet-framework.com/en/guides/write-down-what-a-feature-does/). A colleague has pushed two commits to the shared repository while you were away.

## Pull, then ask which features changed

Pull as usual:

```sh
git pull
```

Then compare with where you were before the pull. Git keeps that commit as `ORIG_HEAD` after every pull:

```sh
npx facet drift --baseline ORIG_HEAD
```

![Terminal output: git pull fast-forwards and changes src/checkout/discount.ts and src/orders/refund.ts; npx facet drift --baseline ORIG_HEAD reports drift for checkout/discounts/redeem-code in src/checkout/discount.ts, 1 drifted anchor.](https://facet-framework.com/guides/see-what-changed-after-pull/drift-after-pull-light.png)

*Two files changed in the pull; one of them carries a documented feature.*

Drift means: code anchored to a record changed, and the record did not. Here, `src/checkout/discount.ts` carries the anchor of the discount-code record. That is the one feature to look at.

Plain `npx facet drift` without `--baseline` compares with `HEAD`, which after a pull already includes the new commits. It reports `No drift found` and adds `a clean result covers only the uncommitted work`. That is why the first comparison needs `ORIG_HEAD`.

## Read only the change that matters

List what came in:

```sh
git log --oneline ORIG_HEAD..HEAD
```

```console
$ git log --oneline ORIG_HEAD..HEAD
1b6bc04 feat(orders): shorten the refund window to 14 days
37a56ea fix(checkout): the minimum order value excludes the threshold itself
```

Then read the diff of the file drift named, and nothing else:

```sh
git diff ORIG_HEAD -- src/checkout/discount.ts
```

```console
$ git diff ORIG_HEAD -- src/checkout/discount.ts
diff --git a/src/checkout/discount.ts b/src/checkout/discount.ts
index 36cb22c..618346b 100644
--- a/src/checkout/discount.ts
+++ b/src/checkout/discount.ts
@@ -33,7 +33,7 @@ export function redeemDiscountCode(cart: Cart, input: string, now = new Date()):
   if (!code) throw new ShopError("E2001");
   if (isExpired(code, now)) throw new ShopError("E2002");
   const total = subtotal(cart);
-  if (code.minSubtotal !== undefined && total < code.minSubtotal) throw new ShopError("E2003");
+  if (code.minSubtotal !== undefined && total <= code.minSubtotal) throw new ShopError("E2003");
   const discount = code.kind === "percent" ? Math.round((total * code.value) / 100) : Math.min(code.value, total);
   return { ...cart, discountCode: code.code, discount };
 }
```

One character with consequences: a cart whose subtotal is exactly the minimum order value used to get the discount. Now the shop refuses it with `E2003`. The record still says "below that value".

## Bring the record in line, or push back

If the new behaviour is intended, change the scenario in `docs/facets/features/checkout/discounts/redeem-code.yaml`:

```text
    - id: minimum-order-value
      statement: |
        Given a code with a minimum order value
        When the cart subtotal is at or below that value
        Then the shop refuses the code with E2003
```

If it is not intended, this is the moment to talk to the colleague, before customers notice. Either way, the record stops describing something the code no longer does.

## Mark the review as done

Record that you have reviewed everything up to now:

```sh
npx facet drift accept --outcome record-updated
```

Check the result:

```sh
npx facet drift
```

![Terminal output: npx facet drift accept --outcome record-updated prints Accepted baseline with a commit hash and time; npx facet drift then reports Baseline: accepted review, record-updated, and No drift found.](https://facet-framework.com/guides/see-what-changed-after-pull/drift-accept-light.png)

*From now on, drift compares with the state you reviewed.*

`accept` stores a snapshot of the working tree as a private git ref of this worktree (`refs/worktree/facet/drift-baseline`). It is not a branch or a tag, is never pushed and changes no file. `--outcome` is a note for yourself: `behavior-unchanged` (the default), `record-updated` or `references-repaired`.

Commit and push the corrected record:

```sh
git add docs/facets/features/checkout/discounts/redeem-code.yaml
git commit -m "Minimum order value: equal to the minimum is now refused"
git push
```

## Check it on the next pull

The next time you pull, plain `drift` is enough, because it now compares with your last review instead of `HEAD`. It also covers several pulls in a row, as long as you have not accepted in between:

```sh
git pull
npx facet drift
```

![Terminal output: git pull fast-forwards one change to src/checkout/discount.ts; npx facet drift against the accepted review reports drift for checkout/discounts/redeem-code, 1 drifted anchor.](https://facet-framework.com/guides/see-what-changed-after-pull/next-pull-light.png)

*A new change to the discount code since your review shows up without any extra flag.*

To read exactly what changed since your review, diff against the stored snapshot:

```sh
git diff refs/worktree/facet/drift-baseline -- src/checkout/discount.ts
```

```console
$ git diff refs/worktree/facet/drift-baseline -- src/checkout/discount.ts
diff --git a/src/checkout/discount.ts b/src/checkout/discount.ts
index 618346b..f15aa32 100644
--- a/src/checkout/discount.ts
+++ b/src/checkout/discount.ts
@@ -29,7 +29,7 @@ function isExpired(code: DiscountCode, now: Date): boolean {
 /** Redeems a code on a cart. Returns the new cart; throws a ShopError and leaves the cart unchanged otherwise. */
 export function redeemDiscountCode(cart: Cart, input: string, now = new Date()): Cart {
   if (cart.discountCode) throw new ShopError("E2004");
-  const code = discountCodes.find((entry) => entry.code === input.trim().toUpperCase());
+  const code = discountCodes.find((entry) => entry.code === input.toUpperCase().trim());
   if (!code) throw new ShopError("E2001");
   if (isExpired(code, now)) throw new ShopError("E2002");
   const total = subtotal(cart);
```

The order of two string operations changed; the behaviour did not. Accept only this file, with the default outcome `behavior-unchanged`:

```sh
npx facet drift accept src/checkout/discount.ts
```

The next `npx facet drift` reports `No drift found` again. Named paths are accepted one by one; changes to other files stay reported until you review them too.

> **What this does not do**
>
> The same pull also shortened the refund window from 30 to 14 days, and drift said nothing: refunds have no record and
> no anchor, so FACET cannot know they are a feature. Drift only covers code that carries an `@facet:` anchor. It also
> never fails a command or a build; it is a reading list. A clean result covers only the window since the baseline.

## If drift says something else

- **`Baseline: HEAD … no review recorded; a clean result covers only the uncommitted work`:** you are comparing with `HEAD`, which already contains the pulled commits. Use `npx facet drift --baseline ORIG_HEAD` right after the pull, or accept once so later runs compare with your review.
- **`drift could not be determined: baseline … does not resolve to a commit`:** the revision you named does not exist, for example `ORIG_HEAD` in a clone that has never pulled. Name the commit you started from instead: `--baseline HEAD@{1}` right after a pull, or a hash from `git reflog`. `ORIG_HEAD` also moves with every later rebase, reset or merge, so use it right after the pull.
- **A file stays reported after you edited its record:** once a review is recorded, editing a record no longer clears drift. Run `npx facet drift accept` for that file.
- **You want to start over:** `npx facet drift reset` forgets the stored review, and drift compares with `HEAD` again.

For more on teams that change each other's features without noticing, read [Your release was green. Ours is broken now.](https://facet-framework.com/en/solutions/distributed-teams/).

### Sources

- [FACET Core](https://github.com/facet-framework/core)
- [Git documentation: `ORIG_HEAD` and other special refs](https://git-scm.com/docs/gitrevisions)
