{"record":{"id":"959a090b11febcba","repo":"sds/overcommit","slug":"argument-splittable-args-index-0-5-exce","errorCode":null,"errorMessage":"Argument `#{splittable_args[index][0..5]}...` exceeds the maximum command length when appended to command prefix and can't be split further","messagePattern":"Argument `#(.+?)\\.\\.\\.` exceeds the maximum command length when appended to command prefix and can't be split further","errorType":"exception","errorClass":"Overcommit::Exceptions::InvalidCommandArgs","httpStatus":null,"severity":"error","filePath":"lib/overcommit/command_splitter.rb","lineNumber":119,"sourceCode":"      end\n\n      # @return [Array<Array<String>, Integer>] tuple of arguments and new index\n      def arguments_under_limit(splittable_args, start_index, byte_limit)\n        index = start_index\n        total_bytes = 0\n\n        loop do\n          break if index > splittable_args.length - 1\n\n          total_bytes += splittable_args[index].bytesize\n          break if total_bytes > byte_limit # Not enough room\n\n          index += 1\n        end\n\n        if index == start_index\n          # No argument was consumed; perhaps a really long argument?\n          raise Overcommit::Exceptions::InvalidCommandArgs,\n                \"Argument `#{splittable_args[index][0..5]}...` exceeds the \" \\\n                'maximum command length when appended to command prefix and ' \\\n                \"can't be split further\"\n        end\n\n        [splittable_args[start_index...index], index]\n      end\n\n      # Returns the maximum number of arguments allowed in a single command on\n      # this system.\n      #\n      # @return [Integer]\n      def max_command_length\n        @max_command_length ||=\n          if Gem.win_platform?\n            # Windows is limited to 2048 since that is a worst-case scenario.\n            # http://blogs.msdn.com/b/oldnewthing/archive/2003/12/10/56028.aspx\n            2048","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/sds/overcommit/blob/fee0cd74b26eb81f64b43b7fab17bbb541575cc4/lib/overcommit/command_splitter.rb#L101-L137","documentation":"Error \"Argument `#{splittable_args[index][0..5]}...` exceeds the maximum command length when appended to command prefix and can't be split further\" thrown in sds/overcommit.","triggerScenarios":"Thrown at lib/overcommit/command_splitter.rb:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the offending single argument (e.g. a very long file path) so it fits within the remaining command-length budget after the command prefix.","Reduce the command prefix size so more room remains for splittable arguments.","Exclude or rename extremely long paths, or run the hook over a narrower set of files."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fee0cd74b26eb81f64b43b7fab17bbb541575cc4","analyzedAt":"2026-08-23T04:07:28.153Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}