Re: [PATCH] bugreport: add 'seconds' to default outfile name
- From
- Dragan Simic <dsimic@manjaro.org>
- Date
- Oct 14, 2023, 16:33 UTC
- Message-ID
- <833da2d05d4b1dfa8e561aa638a927b0@manjaro.org>
- In-Reply-To
- <xmqq4jitw4nk.fsf@gitster.g>
On 2023-10-14 18:27, Junio C Hamano wrote:
Show 21 quoted lines
> Jacob Stopak <jacob@initialcommit.io> writes: >> If a user runs the bugreport command more than once within a calendar >> minute, a filename conflict with an existing file occurs and the >> program >> errors, since the new output filename was already used for the >> previous >> file. > > This is totally expected and you made an excellent observation. > > I personally do not think it is a problem, simply because a quality > bug report that would capture information necessary to diagnose any > issue concisely in a readable fashion would take at least 90 seconds > or more to produce, though. > > Instead of lengthening the filename for all files by 2 digits, the > command can retry by adding say "+1", "+2", etc. after the failed > filename to find a unique suffix within the same minute. It would > mean that after writing git-bugreport-2023-10-14-0920.txt and you > start another one without spending enough time, the new one may > become git-bugreport-2023-10-14-0920+1.txt or something unique.
How about making the filename a bit shorter first, to make room for the additional two digits, so the example mentioned above would end up being named "git-bugreport-20231014-092037.txt"?