Class: Git::Commands::Stash::Show Private
- Defined in:
- lib/git/commands/stash/show.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
arguments block audited against https://git-scm.com/docs/git-stash/2.53.0
Show the changes recorded in a stash entry as a diff
Shows the changes recorded in the stash entry as a diff between the stashed contents and the commit back when the stash entry was first created.
Examples:
Show numstat for the latest stash
Show numstat for the latest stash
Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true)
Show patch for a specific stash
Show patch for a specific stash
Git::Commands::Stash::Show.new(ctx).call('stash@{2}', patch: true, numstat: true, shortstat: true)
Show with directory statistics
Show with directory statistics
Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true, dirstat: true)
Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true, dirstat: 'lines,cumulative')
See Also:
Instance Method Summary collapse
Methods inherited from Base
allow_exit_status, arguments, #initialize, requires_git_version, skip_version_validation
Constructor Details
This class inherits a constructor from Git::Commands::Base
Instance Method Details
#call(**options) ⇒ Git::CommandLine::Result #call(stash, **options) ⇒ Git::CommandLine::Result
Overloads:
-
#call(**options) ⇒ Git::CommandLine::Result
Show diff for the latest stash
Parameters:
-
options
(Hash)
—
command options
Options Hash (**options):
-
:patch
(Boolean, nil)
— default:
nil
—
include unified diff patches per file
-
:numstat
(Boolean, nil)
— default:
nil
—
include per-file insertion/deletion counts
-
:raw
(Boolean, nil)
— default:
nil
—
include per-file mode/SHA/status metadata
-
:shortstat
(Boolean, nil)
— default:
nil
—
include aggregate totals line
-
:unified
(Integer, String)
— default:
nil
—
generate diff with
lines of context Alias: :U
-
:include_untracked
(Boolean, nil)
— default:
nil
—
include untracked files (
--include-untracked)Alias: :u
-
:no_include_untracked
(Boolean, nil)
— default:
nil
—
exclude untracked files (
--no-include-untracked) -
:only_untracked
(Boolean, nil)
— default:
nil
—
show only untracked files
-
:find_renames
(Boolean, Integer, nil)
— default:
nil
—
detect renames; optionally pass a similarity threshold (e.g., 50 for 50%). Alias: :M
-
:find_copies
(Boolean, Integer, nil)
— default:
nil
—
detect copies as well as renames; optionally pass a threshold. Alias: :C
-
:find_copies_harder
(Boolean, nil)
— default:
nil
—
inspect all files as copy sources; expensive
-
:inter_hunk_context
(Integer, String)
— default:
nil
—
show context between diff hunks, up to
lines, fusing hunks that are close to each other -
:dirstat
(Boolean, String, nil)
— default:
nil
—
include directory statistics
Pass
truefor default, or a string like'lines,cumulative'for options.
Returns:
-
(Git::CommandLine::Result)
—
the result of calling
git stash show
-
options
(Hash)
—
-
#call(stash, **options) ⇒ Git::CommandLine::Result
Show diff for a specific stash
Parameters:
-
stash
(String)
—
stash reference (e.g., 'stash@{0}', '0')
-
options
(Hash)
—
command options
Options Hash (**options):
-
:patch
(Boolean, nil)
— default:
nil
—
include unified diff patches per file
-
:numstat
(Boolean, nil)
— default:
nil
—
include per-file insertion/deletion counts
-
:raw
(Boolean, nil)
— default:
nil
—
include per-file mode/SHA/status metadata
-
:shortstat
(Boolean, nil)
— default:
nil
—
include aggregate totals line
-
:unified
(Integer, String)
— default:
nil
—
generate diff with
lines of context Alias: :U
-
:include_untracked
(Boolean, nil)
— default:
nil
—
include untracked files (
--include-untracked)Alias: :u
-
:no_include_untracked
(Boolean, nil)
— default:
nil
—
exclude untracked files (
--no-include-untracked) -
:only_untracked
(Boolean, nil)
— default:
nil
—
show only untracked files
-
:find_renames
(Boolean, Integer, nil)
— default:
nil
—
detect renames; optionally pass a similarity threshold (e.g., 50 for 50%). Alias: :M
-
:find_copies
(Boolean, Integer, nil)
— default:
nil
—
detect copies as well as renames; optionally pass a threshold. Alias: :C
-
:find_copies_harder
(Boolean, nil)
— default:
nil
—
inspect all files as copy sources; expensive
-
:inter_hunk_context
(Integer, String)
— default:
nil
—
show context between diff hunks, up to
lines, fusing hunks that are close to each other -
:dirstat
(Boolean, String, nil)
— default:
nil
—
include directory statistics
Pass
truefor default, or a string like'lines,cumulative'for options.
Returns:
-
(Git::CommandLine::Result)
—
the result of calling
git stash show
-
stash
(String)
—
Parameters:
-
options
(Hash)
—
command options
Options Hash (**options):
-
:patch
(Boolean, nil)
— default:
nil
—
command option key; see overload docs for the full option list
Raises:
-
(ArgumentError)
—
if unsupported options are provided
-
(Git::FailedError)
—
if git exits with a non-zero exit status
|
|
# File 'lib/git/commands/stash/show.rb', line 53
|