[ 
https://issues.apache.org/jira/browse/CASSANDRA-17753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17569423#comment-17569423
 ] 

Michael Semb Wever edited comment on CASSANDRA-17753 at 7/21/22 1:53 PM:
-------------------------------------------------------------------------

I'm good with the PR, and was about to commit, but on some final testing I have 
another question to raise… 

If we build the source when it's not a git clone, for example one of our 
officially voted on release tarballs, the build output gets quick noisy… 

```
get-git-sha:
     [exec] fatal: not a git repository (or any of the parent directories): .git
     [exec] Result: 128
     [echo] git.sha=
     [exec] warning: Not a git repository. Use --no-index to compare two paths 
outside a working tree
     [exec] usage: git diff --no-index [<options>] <path> <path>
     [exec]
     [exec] Diff output format options
     [exec]     -p, --patch           generate patch
     [exec]     -s, --no-patch        suppress diff output
     [exec]     -u                    generate patch
     [exec]     -U, --unified[=<n>]   generate diffs with <n> lines context
     [exec]     -W, --function-context
     [exec]                           generate diffs with <n> lines context
     [exec]     --raw                 generate the diff in raw format
     [exec]     --patch-with-raw      synonym for '-p --raw'
     [exec]     --patch-with-stat     synonym for '-p --stat'
     [exec]     --numstat             machine friendly --stat
     [exec]     --shortstat           output only the last line of --stat
     [exec]     -X, --dirstat[=<param1,param2>...]
     [exec]                           output the distribution of relative 
amount of changes for each sub-directory
     [exec]     --cumulative          synonym for --dirstat=cumulative
     [exec]     --dirstat-by-file[=<param1,param2>...]
     [exec]                           synonym for 
--dirstat=files,param1,param2...
     [exec]     --check               warn if changes introduce conflict 
markers or whitespace errors
     [exec]     --summary             condensed summary such as creations, 
renames and mode changes
     [exec]     --name-only           show only names of changed files
     [exec]     --name-status         show only names and status of changed 
files
     [exec]     --stat[=<width>[,<name-width>[,<count>]]]
     [exec]                           generate diffstat
     [exec]     --stat-width <width>  generate diffstat with a given width
     [exec]     --stat-name-width <width>
     [exec]                           generate diffstat with a given name width
     [exec]     --stat-graph-width <width>
     [exec]                           generate diffstat with a given graph width
     [exec]     --stat-count <count>  generate diffstat with limited lines
     [exec]     --compact-summary     generate compact summary in diffstat
     [exec]     --binary              output a binary diff that can be applied
     [exec]     --full-index          show full pre- and post-image object 
names on the "index" lines
     [exec]     --color[=<when>]      show colored diff
     [exec]     --ws-error-highlight <kind>
     [exec]                           highlight whitespace errors in the 
'context', 'old' or 'new' lines in the diff
     [exec]     -z                    do not munge pathnames and use NULs as 
output field terminators in --raw or --numstat
     [exec]     --abbrev[=<n>]        use <n> digits to display object names
     [exec]     --src-prefix <prefix>
     [exec]                           show the given source prefix instead of 
"a/"
     [exec]     --dst-prefix <prefix>
     [exec]                           show the given destination prefix instead 
of "b/"
     [exec]     --line-prefix <prefix>
     [exec]                           prepend an additional prefix to every 
line of output
     [exec]     --no-prefix           do not show any source or destination 
prefix
     [exec]     --inter-hunk-context <n>
     [exec]                           show context between diff hunks up to the 
specified number of lines
     [exec]     --output-indicator-new <char>
     [exec]                           specify the character to indicate a new 
line instead of '+'
     [exec]     --output-indicator-old <char>
     [exec]                           specify the character to indicate an old 
line instead of '-'
     [exec]     --output-indicator-context <char>
     [exec]                           specify the character to indicate a 
context instead of ' '
     [exec]
     [exec] Diff rename options
     [exec]     -B, --break-rewrites[=<n>[/<m>]]
     [exec]                           break complete rewrite changes into pairs 
of delete and create
     [exec]     -M, --find-renames[=<n>]
     [exec]                           detect renames
     [exec]     -D, --irreversible-delete
     [exec]                           omit the preimage for deletes
     [exec]     -C, --find-copies[=<n>]
     [exec]                           detect copies
     [exec]     --find-copies-harder  use unmodified files as source to find 
copies
     [exec]     --no-renames          disable rename detection
     [exec]     --rename-empty        use empty blobs as rename source
     [exec]     --follow              continue listing the history of a file 
beyond renames
     [exec]     -l <n>                prevent rename/copy detection if the 
number of rename/copy targets exceeds given limit
     [exec]
     [exec] Diff algorithm options
     [exec]     --minimal             produce the smallest possible diff
     [exec]     -w, --ignore-all-space
     [exec]                           ignore whitespace when comparing lines
     [exec]     -b, --ignore-space-change
     [exec]                           ignore changes in amount of whitespace
     [exec]     --ignore-space-at-eol
     [exec]                           ignore changes in whitespace at EOL
     [exec]     --ignore-cr-at-eol    ignore carrier-return at the end of line
     [exec]     --ignore-blank-lines  ignore changes whose lines are all blank
     [exec]     -I, --ignore-matching-lines <regex>
     [exec]                           ignore changes whose all lines match 
<regex>
     [exec]     --indent-heuristic    heuristic to shift diff hunk boundaries 
for easy reading
     [exec]     --patience            generate diff using the "patience diff" 
algorithm
     [exec]     --histogram           generate diff using the "histogram diff" 
algorithm
     [exec]     --diff-algorithm <algorithm>
     [exec]                           choose a diff algorithm
     [exec]     --anchored <text>     generate diff using the "anchored diff" 
algorithm
     [exec]     --word-diff[=<mode>]  show word diff, using <mode> to delimit 
changed words
     [exec]     --word-diff-regex <regex>
     [exec]                           use <regex> to decide what a word is
     [exec]     --color-words[=<regex>]
     [exec]                           equivalent to --word-diff=color 
--word-diff-regex=<regex>
     [exec]     --color-moved[=<mode>]
     [exec]                           moved lines of code are colored 
differently
     [exec]     --color-moved-ws <mode>
     [exec]                           how white spaces are ignored in 
--color-moved
     [exec]
     [exec] Other diff options
     [exec]     --relative[=<prefix>]
     [exec]                           when run from subdir, exclude changes 
outside and show relative paths
     [exec]     -a, --text            treat all files as text
     [exec]     -R                    swap two inputs, reverse the diff
     [exec]     --exit-code           exit with 1 if there were differences, 0 
otherwise
     [exec]     --quiet               disable all output of the program
     [exec]     --ext-diff            allow an external diff helper to be 
executed
     [exec]     --textconv            run external text conversion filters when 
comparing binary files
     [exec]     --ignore-submodules[=<when>]
     [exec]                           ignore changes to submodules in the diff 
generation
     [exec]     --submodule[=<format>]
     [exec]                           specify how differences in submodules are 
shown
     [exec]     --ita-invisible-in-index
     [exec]                           hide 'git add -N' entries from the index
     [exec]     --ita-visible-in-index
     [exec]                           treat 'git add -N' entries as real in the 
index
     [exec]     -S <string>           look for differences that change the 
number of occurrences of the specified string
     [exec]     -G <regex>            look for differences that change the 
number of occurrences of the specified regex
     [exec]     --pickaxe-all         show all changes in the changeset with -S 
or -G
     [exec]     --pickaxe-regex       treat <string> in -S as extended POSIX 
regular expression
     [exec]     -O <file>             control the order in which files appear 
in the output
     [exec]     --rotate-to <path>    show the change in the specified path 
first
     [exec]     --skip-to <path>      skip the output to the specified path
     [exec]     --find-object <object-id>
     [exec]                           look for differences that change the 
number of occurrences of the specified object
     [exec]     --diff-filter [(A|C|D|M|R|T|U|X|B)...[*]]
     [exec]                           select files by diff type
     [exec]     --output <file>       output to a specific file
     [exec]
     [exec] Result: 129
```

and in the `config/version.properties` file the GitSHA is blank.

Are we ok with this? (it's fine by me, but maybe [~aratnofsky] you're keen to 
address it?) 

That is, if someone downloads our official release, builds it and uses it, not 
only is the build containing the above noise, the output of `nodetool version 
-v` becomes
```
ReleaseVersion: 4.2-SNAPSHOT
GitSHA:
```


was (Author: michaelsembwever):
I'm good with the PR, and was about to commit, but on some final testing I have 
another question to raise… 

If we build the source when it's not a git clone, for example one of our 
officially voted on release tarballs, the build output gets quick noisy… 

```
get-git-sha:
     [exec] fatal: not a git repository (or any of the parent directories): .git
     [exec] Result: 128
     [echo] git.sha=
     [exec] warning: Not a git repository. Use --no-index to compare two paths 
outside a working tree
     [exec] usage: git diff --no-index [<options>] <path> <path>
     [exec]
     [exec] Diff output format options
     [exec]     -p, --patch           generate patch
     [exec]     -s, --no-patch        suppress diff output
     [exec]     -u                    generate patch
     [exec]     -U, --unified[=<n>]   generate diffs with <n> lines context
     [exec]     -W, --function-context
     [exec]                           generate diffs with <n> lines context
     [exec]     --raw                 generate the diff in raw format
     [exec]     --patch-with-raw      synonym for '-p --raw'
     [exec]     --patch-with-stat     synonym for '-p --stat'
     [exec]     --numstat             machine friendly --stat
     [exec]     --shortstat           output only the last line of --stat
     [exec]     -X, --dirstat[=<param1,param2>...]
     [exec]                           output the distribution of relative 
amount of changes for each sub-directory
     [exec]     --cumulative          synonym for --dirstat=cumulative
     [exec]     --dirstat-by-file[=<param1,param2>...]
     [exec]                           synonym for 
--dirstat=files,param1,param2...
     [exec]     --check               warn if changes introduce conflict 
markers or whitespace errors
     [exec]     --summary             condensed summary such as creations, 
renames and mode changes
     [exec]     --name-only           show only names of changed files
     [exec]     --name-status         show only names and status of changed 
files
     [exec]     --stat[=<width>[,<name-width>[,<count>]]]
     [exec]                           generate diffstat
     [exec]     --stat-width <width>  generate diffstat with a given width
     [exec]     --stat-name-width <width>
     [exec]                           generate diffstat with a given name width
     [exec]     --stat-graph-width <width>
     [exec]                           generate diffstat with a given graph width
     [exec]     --stat-count <count>  generate diffstat with limited lines
     [exec]     --compact-summary     generate compact summary in diffstat
     [exec]     --binary              output a binary diff that can be applied
     [exec]     --full-index          show full pre- and post-image object 
names on the "index" lines
     [exec]     --color[=<when>]      show colored diff
     [exec]     --ws-error-highlight <kind>
     [exec]                           highlight whitespace errors in the 
'context', 'old' or 'new' lines in the diff
     [exec]     -z                    do not munge pathnames and use NULs as 
output field terminators in --raw or --numstat
     [exec]     --abbrev[=<n>]        use <n> digits to display object names
     [exec]     --src-prefix <prefix>
     [exec]                           show the given source prefix instead of 
"a/"
     [exec]     --dst-prefix <prefix>
     [exec]                           show the given destination prefix instead 
of "b/"
     [exec]     --line-prefix <prefix>
     [exec]                           prepend an additional prefix to every 
line of output
     [exec]     --no-prefix           do not show any source or destination 
prefix
     [exec]     --inter-hunk-context <n>
     [exec]                           show context between diff hunks up to the 
specified number of lines
     [exec]     --output-indicator-new <char>
     [exec]                           specify the character to indicate a new 
line instead of '+'
     [exec]     --output-indicator-old <char>
     [exec]                           specify the character to indicate an old 
line instead of '-'
     [exec]     --output-indicator-context <char>
     [exec]                           specify the character to indicate a 
context instead of ' '
     [exec]
     [exec] Diff rename options
     [exec]     -B, --break-rewrites[=<n>[/<m>]]
     [exec]                           break complete rewrite changes into pairs 
of delete and create
     [exec]     -M, --find-renames[=<n>]
     [exec]                           detect renames
     [exec]     -D, --irreversible-delete
     [exec]                           omit the preimage for deletes
     [exec]     -C, --find-copies[=<n>]
     [exec]                           detect copies
     [exec]     --find-copies-harder  use unmodified files as source to find 
copies
     [exec]     --no-renames          disable rename detection
     [exec]     --rename-empty        use empty blobs as rename source
     [exec]     --follow              continue listing the history of a file 
beyond renames
     [exec]     -l <n>                prevent rename/copy detection if the 
number of rename/copy targets exceeds given limit
     [exec]
     [exec] Diff algorithm options
     [exec]     --minimal             produce the smallest possible diff
     [exec]     -w, --ignore-all-space
     [exec]                           ignore whitespace when comparing lines
     [exec]     -b, --ignore-space-change
     [exec]                           ignore changes in amount of whitespace
     [exec]     --ignore-space-at-eol
     [exec]                           ignore changes in whitespace at EOL
     [exec]     --ignore-cr-at-eol    ignore carrier-return at the end of line
     [exec]     --ignore-blank-lines  ignore changes whose lines are all blank
     [exec]     -I, --ignore-matching-lines <regex>
     [exec]                           ignore changes whose all lines match 
<regex>
     [exec]     --indent-heuristic    heuristic to shift diff hunk boundaries 
for easy reading
     [exec]     --patience            generate diff using the "patience diff" 
algorithm
     [exec]     --histogram           generate diff using the "histogram diff" 
algorithm
     [exec]     --diff-algorithm <algorithm>
     [exec]                           choose a diff algorithm
     [exec]     --anchored <text>     generate diff using the "anchored diff" 
algorithm
     [exec]     --word-diff[=<mode>]  show word diff, using <mode> to delimit 
changed words
     [exec]     --word-diff-regex <regex>
     [exec]                           use <regex> to decide what a word is
     [exec]     --color-words[=<regex>]
     [exec]                           equivalent to --word-diff=color 
--word-diff-regex=<regex>
     [exec]     --color-moved[=<mode>]
     [exec]                           moved lines of code are colored 
differently
     [exec]     --color-moved-ws <mode>
     [exec]                           how white spaces are ignored in 
--color-moved
     [exec]
     [exec] Other diff options
     [exec]     --relative[=<prefix>]
     [exec]                           when run from subdir, exclude changes 
outside and show relative paths
     [exec]     -a, --text            treat all files as text
     [exec]     -R                    swap two inputs, reverse the diff
     [exec]     --exit-code           exit with 1 if there were differences, 0 
otherwise
     [exec]     --quiet               disable all output of the program
     [exec]     --ext-diff            allow an external diff helper to be 
executed
     [exec]     --textconv            run external text conversion filters when 
comparing binary files
     [exec]     --ignore-submodules[=<when>]
     [exec]                           ignore changes to submodules in the diff 
generation
     [exec]     --submodule[=<format>]
     [exec]                           specify how differences in submodules are 
shown
     [exec]     --ita-invisible-in-index
     [exec]                           hide 'git add -N' entries from the index
     [exec]     --ita-visible-in-index
     [exec]                           treat 'git add -N' entries as real in the 
index
     [exec]     -S <string>           look for differences that change the 
number of occurrences of the specified string
     [exec]     -G <regex>            look for differences that change the 
number of occurrences of the specified regex
     [exec]     --pickaxe-all         show all changes in the changeset with -S 
or -G
     [exec]     --pickaxe-regex       treat <string> in -S as extended POSIX 
regular expression
     [exec]     -O <file>             control the order in which files appear 
in the output
     [exec]     --rotate-to <path>    show the change in the specified path 
first
     [exec]     --skip-to <path>      skip the output to the specified path
     [exec]     --find-object <object-id>
     [exec]                           look for differences that change the 
number of occurrences of the specified object
     [exec]     --diff-filter [(A|C|D|M|R|T|U|X|B)...[*]]
     [exec]                           select files by diff type
     [exec]     --output <file>       output to a specific file
     [exec]
     [exec] Result: 129
```

and in the `config/version.properties` file the GitSHA is blank.

Are we ok with this? (it's fine by me, but maybe [~aratnofsky] you're keen to 
address it?) 



> Include GitSHA in nodetool version output
> -----------------------------------------
>
>                 Key: CASSANDRA-17753
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17753
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tool/nodetool
>            Reporter: Abe Ratnofsky
>            Assignee: Abe Ratnofsky
>            Priority: Normal
>             Fix For: 4.x
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> It can be useful to see specifically which Git SHA a running instance of 
> Cassandra was built with, especially when running clusters in development for 
> soak testing.
>  
> I have a patch ready for this, and am preparing it now.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to