diff --git a/README.md b/README.md index 37b3774..05cf4be 100644 --- a/README.md +++ b/README.md @@ -29,19 +29,19 @@ This tool provides advanced Git feature management, allowing you to associate fe ## Commands Overview -### `git feature-status` +### `git feature status` Displays the current feature status, including staged, unstaged, and untracked files with their associated features. **Usage**: ```bash -git feature-status +git feature status ``` -### `git feature-add` +### `git feature add` This command helps to associate feature information with a commit that does not yet exist. You can either add the information while adding the files or add features to the staging area. If you prefer to keep your workflows as usual and add feature information solely to commits that you already created, you don't need the git hooks and can jump to `git feature-commit`. -#### `git feature-add by-add` +#### `git feature add` Associates specified features with staged files. You can stage specific files or all tracked changes. @@ -51,62 +51,65 @@ Associates specified features with staged files. You can stage specific files or **Usage**: ```bash -git feature-add by-add --all -git feature-add by-add --files ... +git feature add --all +git feature add --files ... ``` -#### `git feature-add from-staged` +#### `git feature add-from-staged` Uses staged files to associate them with feature information. **Usage**: ```bash -git feature-add from-staged +git feature add-from-staged ``` -### `git feature-commit` +### `git feature commit` Assign features to a commit retroactively. To find all commits that have not yet features assigned, see --- **Usage**: ```bash -git feature-commit +git feature commit ``` -### `git feature-blame` +### `git feature blame` Displays the feature associations for each line of a specified file, similar to `git blame`. **Usage**: ```bash -git feature-blame +git feature blame ``` -### `git feature-info` +### `git feature info` Displays detailed information about a feature, including associated commits, files, authors, and branches. **Options**: - `--authors`: Lists the authors who contributed to the feature. - `--files`: Lists the files associated with the feature. -- `--branches`: Lists the branches where the feature is found. +- `--branches`: Lists the branches where the feature is present. +- `--updatable`: Check if the feature has updates available on other branches and list the update options. +- `--branch `: Specify a branch for checking updates (used with `--updatable`). **Usage**: ```bash -git feature-info -git feature-info --authors --files --branches +git feature info +git feature info --authors --files --branches ``` -### `git feature-commits` +### `git feature commits` Lists all commits associated with a feature or shows commits that are missing feature associations. -**Options**: -- `--missing`: Lists commits that do not have any associated feature. +**Commands**: +- `missing`: Lists commits that do not have any associated feature. +- `list`: List commits that are associated to features. **Usage**: ```bash -git feature-commits -git feature-commits --missing +git feature commits list +git feature commits missing ``` --- @@ -115,38 +118,38 @@ git feature-commits --missing 1. **Check Feature Status**: ```bash - git feature-status + git feature status ``` 2. **Add Features to All Files**: ```bash - git feature-add by-add --all "new-feature" + git feature add --all "new-feature" ``` 3. **Add Features to Specific Files**: ```bash - git feature-add by-add --files src/main.py "feature-x" + git feature add --files src/main.py "feature-x" ``` 4. **Use Staged Files for Feature Information**: ```bash - git feature-add from-staged + git feature add-from-staged ``` 5. **Show Feature Associations for a File**: ```bash - git feature-blame src/main.py + git feature blame src/main.py ``` 6. **Display Feature Information**: ```bash - git feature-info feature-x --authors --files --branches + git feature info feature-x --authors --files --branches ``` 7. **List All Commits With and Without Features**: ```bash - git feature-commits - git feature-commits --missing + git feature commits list + git feature commits missing ``` --- diff --git a/git_tool/helpdoc/git-feature.1 b/git_tool/helpdoc/git-feature.1 new file mode 100644 index 0000000..f14d574 --- /dev/null +++ b/git_tool/helpdoc/git-feature.1 @@ -0,0 +1,26 @@ +.TH git-feature 1 "12 April 2025" "Kim Nguyen" "git-feature(1) Manual Page" +.SH NAME +git-feature - Manage feature metadata and inspect feature-related information + +.SH SYNOPSIS +.P +\fB git feature status \fP +.P +\fB git feature add \fP [-a | --all | -f | --files ] +.P +\fB git feature add-from-staged \fP +.P +\fB git feature commit \fP [--features ] +.P +\fB git feature commits missing \fP +.P +\fB git feature commits list \fP +.P +\fB git feature blame \fP +.P +\fB git feature info-all \fP +.P +\fBgit feature info\fP [--authors | --files | --branches | --updatable | --branch ] + +.SH COMMANDS +With no arguments, shows the help text. Several subcommands are available to perform operations on the feature metadata. \ No newline at end of file diff --git a/git_tool/helpdoc/git-feature.html b/git_tool/helpdoc/git-feature.html new file mode 100644 index 0000000..49a4551 --- /dev/null +++ b/git_tool/helpdoc/git-feature.html @@ -0,0 +1,2323 @@ + + + + + + + + git-feature(1) + + + + + +
+
+

SYNOPSIS

+
+
+
git feature status
+git feature add <feature_names> (-a | --all | -f <file_name> | --files <file_name>)
+git feature add-from-staged
+git feature commit <commit_id> [--features <feature_name>]
+git feature commits list
+git feature commits missing
+git feature blame <file_name>
+git feature info-all [--push] <name> <newurl> [<oldurl>]
+git feature info [--authors | --files | --branches | --updatable | --branch <branch_name>]
+
+
+
+
+

DESCRIPTION

+
+
+

Associate features with commits and files in a repository, manage feature metadata, and inspect feature-related information.

+
+
+
+
+

COMMANDS

+
+
+

With no subcommands, shows the help text. Several subcommands are available to track and manage feature information.

+
+
+
+
status
+
+

Displays the current status of files in the working directory, showing staged, unstaged, and untracked changes + along with their associated features. This command is intended to be used with the following commands to add + feature information while staging files. It can also be used to aid in the selection of files for the next commit.

+
+
add
+
+

Stage specific <file_names> or all files and associate them with the provided features.

+
+

With -a or --all, you can stage all tracked changes and associate them with the features.

+
+
+

With -f or --files, you can stage a <file_name> and associate it with the features. + You can use this option multiple times to stage multiple files.

+
+
+
add-from-staged
+
+

Associate features with the currently staged files. Currently, it derives the feature list from the previously selected + features for those files and is not fully implemented yet.

+
+
commit
+
+

Associates feature information with an existing commit. This is useful when you want to add feature metadata to a commit + after it has been created.

+
+

With --features, a feature name is manually specified. You can use this option multiple times to associate + multiple features. If this is provided, staged feature information will be ignored. Otherwise, the program will try + to derive the information.

+
+
+
commits
+
+

Provides information about commits that are either already associated, or have not yet been associated with a feature. + This is especially useful when transitioning to feature-based workflows or when tracing commits for specific features. + It helps identifying which commits have feature metadata associated and which do not, ensuring that no commit is left + untracked.

+
+

With the list subcommand, show a list of commits that are already associated with features.

+
+
+

With the missing subcommand, show a list of commits that have not yet been associated with features.

+
+
+
blame
+
+

Display features associated with <file_name> lines. Currently, it shows the associated file and has not yet been fully + implemented yet.

+
+
info-all
+
+

List all available features in the project.

+
+
info
+
+

Shows detailed information about the feature <feature_name>, including authors, files, branches, and update status.

+
+

With --authors, show all authors who contributed to this feature.

+
+
+

With --files, list all files associated with this feature.

+
+
+

With --branches, show all branches where this feature is present.

+
+
+

With --branch <branch_name>, show all branches where this feature is present.

+
+
+
+
+
+
+
+

EXAMPLE WORKFLOWS

+
+
+
    +
  • +

    Assess the file location for feature authentication, inspect its commit history, and list its authors

    +
    +
    +
    $ git feature info "authentication" --files
    +    Files associated with 'authentication':
    +    - src/auth/login.py
    +    - src/auth/logout.py
    +    - src/auth/utils.py
    +
    +$ git feature info "authentication" --log
    +    Recent commits for 'authentication':
    +    − mno7890 : Improved password hashing algorithm
    +    − abc1234 : Implemented login functionality
    +    ...
    +$ git show mno7890
    +    commit mno7890
    +    Author: Bob <bob@company.com >
    +    Date: Mon Apr 01 11:12:13 2024
    +    Improved password hashing algorithm
    +
    +    The one used before had a problem.
    +    diff −−git a/src/auth/utils.pyb/src/auth/utils.py
    +    <diff of the commit>
    +
    +$ git feature info "authentication" --authors
    +    Top contributors to 'authentication':
    +    − Alice Smith (5 commits)
    +    − Bob Johnson (3 commits)
    +
    +
    +
  • +
  • +

    Analyze and stage changes, associate with feature add and commit the changes

    +
    +
    +
    $ git feature status
    +    Unstaged changes:
    +        src/main.py [add]
    +        src/operations.py [subtract, add]
    +        src/utils.py [core]
    +
    +$ git feature add "core" --file src/utils.py
    +    Feature 'core' associated with staged changes.
    +
    +$ git feature status
    +    Unstaged changes:
    +        src/main.py [add]
    +        src/operations.py [subtract, add]
    +
    +    Staged changes:
    +        src/utils.py [core]
    +
    +$ git commit
    +    [main abc1234] Implemented new functionality for core
    +    Feature: core
    +    1 file changed, 50 insertions(+), 10 deletions(-)
    +
    +
    +
    +
  • +
  • +

    Assign feature core to an already existing commit

    +
    +
    +
    $ git log -n 1 --oneline
    +    abc1234 (HEAD -> main) Implemented new functionality for core
    +
    +$ git feature commit "core" abc1234
    +
    +
    +
    +
  • +
+
+
+
+
+

GIT

+
+
+

A Git extension built by Tabea Röthemeyer and improved by Kim Nguyen in collaboration with the Software + Engineering Faculty of the Ruhr-Universität Bochum.

+
+
+
+
+ + + \ No newline at end of file