detect "dirty" git working tree

Open
#1,962 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
git, go
Domain
cli

Research direction

Begin at the bundle deploy/update path that reports the Git branch and commit hash, then inspect how it obtains Git metadata. Verify the result with a checkout containing an uncommitted change to a synced file and confirm the displayed commit identifier marks the deployment as dirty.

Written by the indexing model from the issue text.

Description

DABs Enhancement No Autoclose
Describe the issue

When deploy/update a bundle, it will show the Git Branch and Commit Hash-ID.
But if the user has un-committed changes, this technically not correct.

Configuration

Just change any of the files being synced, in your local Git checkout, and do a deploy without doing a "git add / commit" first.

Expected Behavior

It should some how show that the deploy is "dirty", possibly by just suffixing the Commit Hash-ID with -dirty
An example how it can be detected (there might be better options):

[[ -n `git status -s` ]] && echo "dirty"

If it could also detect if the commit is local-only or also pushed to "remote origin", would be a really cool bonus!

Actual Behavior

It just shows the last committed Hash ID, which doesn't reflect that the files and resources might be different than the source-of-truth.

Dominant language
Go
Stars
427
Forks
267
Avg merge
2d 1h
Merged PRs (30d)
233

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/cli

All issues in databricks/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.