Fix generic typos in comments
PATCH 1/2 Fix generic typos in comments
Hi, I wrote a tool that effectively fixes typos in comments and only in comments.
It can be downloaded here:
https://github.com/neleai/stylepp
For typos you need identify them, write replacement dictionary and run STYLEPP/script/stylepp_skeleton stylepp_fix_comment
Here generic dictionary is used that was taken from wikipedia.
https://github.com/neleai/stylepp/blob/master/maintained/dictionary_wiki
--- bisect.c | 2 +- builtin/apply.c | 6 +++--- builtin/clean.c | 2 +- builtin/update-index.c | 4 ++-- compat/regex/regcomp.c | 10 +++++----- compat/regex/regex_internal.c | 2 +- compat/regex/regexec.c | 4 ++-- connect.c | 2 +- daemon.c | 2 +- diff.c | 2 +- dir.c | 2 +- entry.c | 2 +- fast-import.c | 2 +- parse-options.c | 2 +- read-cache.c | 2 +- refs.c | 2 +- remote.c | 14 +++++++------- revision.c | 2 +- sha1-lookup.c | 2 +- sha1_file.c | 2 +- sha1_name.c | 2 +- transport.c | 2 +- 22 files changed, 36 insertions(+), 36 deletions(-)
bisect.c +1 -1
@@ -845,7 +845,7 @@ static void check_good_are_ancestors_of_bad(const char *prefix, int no_checkout)if (!stat (filename, &st) &&S_ISREG (st.st_mode)) goto done; -/* Bisecting with no good rev is ok. */ +/* Bisecting with no good rev is OK. */ if (good_revs.nr ==0 ) goto done;
builtin/apply.c +3 -3
@@ -3659,12 +3659,12 @@ static void build_fake_ancestor(struct patch *list, const char *filename)if (S_ISGITLINK (patch->old_mode)) {if (!preimage_sha1_in_gitlink_patch (patch, sha1)) - ;/* ok, the textual part looks sane */ + ;/* OK, the textual part looks sane */ else die ("sha1 information is lacking or useless for submoule %s" , name); }else if (!get_sha1_blob (patch->old_sha1_prefix, sha1)) { - ;/* ok */ + ;/* OK */ }else if (!patch->lines_added && !patch->lines_deleted) {/* mode-only change: update the current */ if (get_current_sha1 (patch->old_name, sha1))
@@ -3755,7 +3755,7 @@ static void show_rename_copy(struct patch *p) old = slash_old +1 ; new = slash_new +1 ; } -/* p->old_name thru old is the common prefix, and old and new +/* p->old_name through old is the common prefix, and old and new * through the end of names are renames */ if (old != p->old_name)
builtin/clean.c +1 -1
@@ -89,7 +89,7 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,strbuf_setlen (path, len);strbuf_addstr (path, e->d_name);if (lstat (path->buf, &st)) - ;/* fall thru */ + ;/* fall through */ else if (S_ISDIR (st.st_mode)) {if (remove_dirs (path, prefix, force_flag, dry_run, quiet, &gone)) ret =1 ;
builtin/update-index.c +2 -2
@@ -71,10 +71,10 @@ static int remove_one_path(const char *path)/* * Handle a path that couldn't be lstat'ed. It's either: -* - missing file (ENOENT or ENOTDIR). That's ok if we're +* - missing file (ENOENT or ENOTDIR). That's OK if we're * supposed to be removing it and the removal actually * succeeds. -* - permission error. That's never ok. +* - permission error. That's never OK. */ static int process_lstat_error (const char *path,int err) {
compat/regex/regcomp.c +5 -5
@@ -2617,7 +2617,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,Build the range expression which starts from START_ELEM, and ends at END_ELEM. The result are written to MBCSET and SBCSET. RANGE_ALLOC is the allocated size of mbcset->range_starts, and -mbcset->range_ends, is a pointer argument sinse we may +mbcset->range_ends, is a pointer argument since we may update it. */ static reg_errcode_t
@@ -2896,7 +2896,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,Build the range expression which starts from START_ELEM, and ends at END_ELEM. The result are written to MBCSET and SBCSET. RANGE_ALLOC is the allocated size of mbcset->range_starts, and -mbcset->range_ends, is a pointer argument sinse we may +mbcset->range_ends, is a pointer argument since we may update it. */ auto inline reg_errcode_t
@@ -2980,7 +2980,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,Build the collating element which is represented by NAME. The result are written to MBCSET and SBCSET. COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a -pointer argument sinse we may update it. */ +pointer argument since we may update it. */ autoinline reg_errcode_t __attribute ((always_inline))
@@ -3419,7 +3419,7 @@ parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,Build the equivalence class which is represented by NAME. The result are written to MBCSET and SBCSET. EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes, -is a pointer argument sinse we may update it. */ +is a pointer argument since we may update it. */ static reg_errcode_t #ifdef RE_ENABLE_I18N
@@ -3515,7 +3515,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)Build the character class which is represented by NAME. The result are written to MBCSET and SBCSET. CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes, -is a pointer argument sinse we may update it. */ +is a pointer argument since we may update it. */ static reg_errcode_t #ifdef RE_ENABLE_I18N
compat/regex/regex_internal.c +1 -1
@@ -973,7 +973,7 @@ re_node_set_alloc (re_node_set *set, int size)/* * ADR: valgrind says size can be 0, which then doesn't * free the block of size 0. Harumph. This seems -* to work ok, though. +* to work OK, though. */ if (size ==0 ) {
compat/regex/regexec.c +2 -2
@@ -455,7 +455,7 @@ re_search_stub (struct re_pattern_buffer *bufp, rval =0 ; -/* I hope we needn't fill ther regs with -1's when no match was found. */ +/* I hope we needn't fill their regs with -1's when no match was found. */ if (result !=REG_NOERROR ) rval =-1 ;else if (regs !=NULL )
@@ -1071,7 +1071,7 @@ acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,FL_LONGEST_MATCH means we want the POSIX longest matching. If P_MATCH_FIRST is not NULL, and the match fails, it is set to the next place where we may want to try matching. -Note that the matcher assume that the maching starts from the current +Note that the matcher assume that the matching starts from the current index of the buffer. */ static int
connect.c +1 -1
@@ -33,7 +33,7 @@ static int check_ref(const char *name, int len, unsigned int flags)if ((flags &REF_TAGS ) && !memcmp (name,"tags/" ,5 ))return 1 ; -/* All type bits clear means that we are ok with anything */ +/* All type bits clear means that we are OK with anything */ return !(flags & ~REF_NORMAL ); }
daemon.c +1 -1
@@ -339,7 +339,7 @@ static int run_service(char *dir, struct daemon_service *service)* * We want a readable HEAD, usable "objects" directory, and * a "git-daemon-export-ok" flag that says that the other side -* is ok with us doing this. +* is OK with us doing this. * * path_ok() uses enter_repo() and does whitelist checking. * We only need to make sure the repository is exported.
diff.c +1 -1
@@ -2043,7 +2043,7 @@ static int is_conflict_marker(const char *line, int marker_size, unsigned long lfor (cnt =1 ; cnt < marker_size; cnt++)if (line[cnt] != firstchar)return 0 ; -/* line[1] thru line[marker_size-1] are same as firstchar */ +/* line[1] through line[marker_size-1] are same as firstchar */ if (len < marker_size +1 || !isspace (line[marker_size]))return 0 ;return 1 ;
dir.c +1 -1
@@ -1502,7 +1502,7 @@ static int remove_dir_recurse(struct strbuf *path, int flag, int *kept_up)strbuf_setlen (path, len);strbuf_addstr (path, e->d_name);if (lstat (path->buf, &st)) - ;/* fall thru */ + ;/* fall through */ else if (S_ISDIR (st.st_mode)) {if (!remove_dir_recurse (path, flag, &kept_down))continue ;/* happy */
entry.c +1 -1
@@ -26,7 +26,7 @@ static void create_directories(const char *path, int path_len,* stat() function instead of the lstat() function. */ if (has_dirs_only_path (buf, len, state->base_dir_len)) -continue ;/* ok, it is already a directory. */ +continue ;/* OK, it is already a directory. */ /* * If this mkdir() would fail, it could be that there
fast-import.c +1 -1
@@ -2281,7 +2281,7 @@ static void file_change_m(struct branch *b)case S_IFLNK :case S_IFDIR :case S_IFGITLINK : -/* ok */ +/* OK */ break ;default :die ("Corrupt mode: %s" , command_buf.buf);
parse-options.c +1 -1
@@ -328,7 +328,7 @@ static void parse_options_check(const struct option *opts) !(opts->flags & PARSE_OPT_NOARG)) err |=optbug (opts,"should not accept an argument" );default : - ;/* ok. (usually accepts an argument) */ + ;/* OK. (usually accepts an argument) */ } }if (err)
read-cache.c +1 -1
@@ -874,7 +874,7 @@ static int has_dir_name(struct index_state *istate,/* * Trivial optimization: if we find an entry that * already matches the sub-directory, then we know -* we're ok, and we can exit. +* we're OK, and we can exit. */ while (pos < istate->cache_nr) {struct cache_entry *p = istate->cache[pos];
refs.c +1 -1
@@ -3073,7 +3073,7 @@ int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void scanp = buf -1 ;/* leave loop */ }else {/* -* (bp + 1) thru endp is the beginning of the +* (bp + 1) through endp is the beginning of the * current line we have in sb */ strbuf_splice (&sb,0 ,0 , bp +1 , endp - (bp +1 ));
remote.c +7 -7
@@ -566,20 +566,20 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp/* LHS */ if (!*rs[i].src) - ;/* empty is ok; it means "HEAD" */ + ;/* empty is OK; it means "HEAD" */ else if (llen ==40 && !get_sha1_hex (rs[i].src, unused)) - rs[i].exact_sha1 =1 ;/* ok */ + rs[i].exact_sha1 =1 ;/* OK */ else if (!check_refname_format (rs[i].src, flags)) - ;/* valid looking ref is ok */ + ;/* valid looking ref is OK */ else goto invalid;/* RHS */ if (!rs[i].dst) - ;/* missing is ok; it is the same as empty */ + ;/* missing is OK; it is the same as empty */ else if (!*rs[i].dst) - ;/* empty is ok; it means "do not store" */ + ;/* empty is OK; it means "do not store" */ else if (!check_refname_format (rs[i].dst, flags)) - ;/* valid looking ref is ok */ + ;/* valid looking ref is OK */ else goto invalid; }else {
@@ -591,7 +591,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp* there is no existing way to validate this. */ if (!*rs[i].src) - ;/* empty is ok */ + ;/* empty is OK */ else if (is_glob) {if (check_refname_format (rs[i].src, flags)) goto invalid;
revision.c +1 -1
@@ -157,7 +157,7 @@ void mark_parents_uninteresting(struct commit *commit)while (commit) {/* -* A missing commit is ok iff its parent is marked +* A missing commit is OK iff its parent is marked * uninteresting. * * We just mark such a thing parsed, so that when
sha1-lookup.c +1 -1
@@ -201,7 +201,7 @@ int sha1_entry_pos(const void *table,break ; ofs_0 = ofs;/* -* byte 0 thru (ofs-1) are the same between +* byte 0 through (ofs-1) are the same between * lo and hi; ofs is the first byte that is * different. */
sha1_file.c +1 -1
@@ -974,7 +974,7 @@ struct packed_git *add_packed_git(const char *path, int path_len, int local)return NULL ; } -/* ok, it looks sane as far as we can check without +/* OK, it looks sane as far as we can check without * actually mapping the pack file. */ p->pack_size = st.st_size;
sha1_name.c +1 -1
@@ -1052,7 +1052,7 @@ static int reinterpret(const char *name, int namelen, int len, struct strbuf *bu* If the input is not of the accepted format, it returns a negative * number to signal an error. * -* If the input was ok but there are not N branch switches in the +* If the input was OK but there are not N branch switches in the * reflog, it returns 0. */ int interpret_branch_name (const char *name,struct strbuf *buf)
transport.c +1 -1
@@ -1298,7 +1298,7 @@ char *transport_anonymize_url(const char *url)switch (*cp) {/* RFC 1738 2.1 */ case '+' :case '.' :case '-' : -break ;/* ok */ +break ;/* OK */ default :if (isalnum (*cp))break ;
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] Fix typos in comments
Hi, I wrote a tool that effectively fixes typos in comments and only in comments.
It can be downloaded here:
https://github.com/neleai/stylepp
Now I fix specific typos. First I need to generate list of likely typos. This is done by running following commands in desired directory
STYLEPP/script/stylepp_spellcheck # then
STYLEPP/script/stylepp_dictionary
This creates an dictionary so we can use
STYLEPP/script/stylepp_skeleton stylepp_fix_comment
A dictionary that I generated is following, patch is below.
accreting accrediting
alloted allocated
apporiate appropriate
becaue because
behaviour behavior
coalesed coalesced
colourful colorful
commentz comments
commmit commit
converison conversion
correspoding corresponding
descendent descendant
descendents descendants
ententries entries
environement environment
erroring erring
explicitely explicitly
happear appear
identifer identifier
initialied initialized
initialised initialized
intialize initialize
matcing matching
programing programming
sastisfies satisfies
satisify satisfy
sequemces sequences
timming trimming
traling trailing
transiton transition
writeable writable
--- builtin/apply.c | 2 +- builtin/checkout.c | 2 +- builtin/fast-export.c | 2 +- builtin/log.c | 2 +- builtin/mktree.c | 2 +- builtin/push.c | 2 +- builtin/tar-tree.c | 2 +- builtin/update-index.c | 2 +- cache.h | 2 +- combine-diff.c | 2 +- commit-slab.h | 2 +- compat/nedmalloc/malloc.c.h | 8 ++++---- compat/obstack.h | 2 +- compat/poll/poll.h | 2 +- compat/precompose_utf8.c | 2 +- compat/regex/regcomp.c | 8 ++++---- compat/regex/regexec.c | 4 ++-- convert.c | 2 +- convert.h | 2 +- diff-no-index.c | 2 +- diff.c | 4 ++-- kwset.c | 10 +++++----- notes.h | 8 ++++---- read-cache.c | 2 +- refs.h | 2 +- revision.c | 2 +- sha1_name.c | 2 +- transport-helper.c | 4 ++-- write_or_die.c | 2 +- xdiff/xprepare.c | 2 +- 30 files changed, 46 insertions(+), 46 deletions(-)
builtin/apply.c +1 -1
@@ -132,7 +132,7 @@ static void set_default_whitespace_mode(const char *whitespace_option) }/* -* For "diff-stat" like behaviour, we keep track of the biggest change +* For "diff-stat" like behavior, we keep track of the biggest change * we've seen, and the longest filename. That allows us to do simple * scaling. */
builtin/checkout.c +1 -1
@@ -1137,7 +1137,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)* 3) git checkout <something> [<paths>] * * including "last branch" syntax and DWIM-ery for names of -* remote branches, erroring out for invalid or ambiguous cases. +* remote branches, erring out for invalid or ambiguous cases. */ if (argc) {unsigned char rev[20 ];
builtin/fast-export.c +1 -1
@@ -379,7 +379,7 @@ static void handle_tag(const char *name, struct tag *tag)int tagged_mark;struct commit *p; -/* Trees have no identifer in fast-export output, thus we have no way +/* Trees have no identifier in fast-export output, thus we have no way * to output tags of trees, tags of tags of trees, etc. Simply omit * such tags. */
builtin/log.c +1 -1
@@ -1348,7 +1348,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)if (rev.max_count <0 && !rev.show_root_diff) {/* -* This is traditional behaviour of "git format-patch +* This is traditional behavior of "git format-patch * origin" that prepares what the origin side still * does not have. */
builtin/mktree.c +1 -1
@@ -176,7 +176,7 @@ int cmd_mktree(int ac, const char **av, const char *prefix)/* * Execution gets here if the last tree entry is terminated with a * new-line. The final new-line has been made optional to be -* consistent with the original non-batch behaviour of mktree. +* consistent with the original non-batch behavior of mktree. */ ;/* skip creating an empty tree */ }else {
builtin/push.c +1 -1
@@ -92,7 +92,7 @@ static NORETURN int die_push_simple(struct branch *branch, struct remote *remoteif (!short_upstream) short_upstream = branch->merge[0 ]->src;/* -* Don't show advice for people who explicitely set +* Don't show advice for people who explicitly set * push.default. */ if (push_default ==PUSH_DEFAULT_UNSPECIFIED )
builtin/tar-tree.c +1 -1
@@ -42,7 +42,7 @@ int cmd_tar_tree(int argc, const char **argv, const char *prefix)/* * Because it's just a compatibility wrapper, tar-tree supports only -* the old behaviour of reading attributes from the work tree. +* the old behavior of reading attributes from the work tree. */ nargv[nargc++] ="--worktree-attributes" ;
builtin/update-index.c +1 -1
@@ -124,7 +124,7 @@ static int add_one_path(struct cache_entry *old, const char *path, int len, stru* exist as such any more. If removal isn't allowed, it's * an error. * -* (NOTE! This is old and arguably fairly strange behaviour. +* (NOTE! This is old and arguably fairly strange behavior. * We might want to make this an error unconditionally, and * use "--force-remove" if you actually want to force removal). *
cache.h +1 -1
@@ -489,7 +489,7 @@ extern void *read_blob_data_from_index(struct index_state *, const char *, unsigextern int ie_match_stat (const struct index_state *,const struct cache_entry *,struct stat *,unsigned int );extern int ie_modified (const struct index_state *,const struct cache_entry *,struct stat *,unsigned int ); -#define PATHSPEC_ONESTAR 1/* the pathspec pattern sastisfies GFNM_ONESTAR */ +#define PATHSPEC_ONESTAR 1/* the pathspec pattern satisfies GFNM_ONESTAR */ struct pathspec {const char **raw;/* get_pathspec() result, not freed by free_pathspec() */
combine-diff.c +1 -1
@@ -165,7 +165,7 @@ static struct lline *coalesce_lines(struct lline *base, int *lenbase,/* * Coalesce new lines into base by finding the LCS -* - Create the table to run dynamic programing +* - Create the table to run dynamic programming * - Compute the LCS * - Then reverse read the direction structure: * - If we have MATCH, assign parent to base flag, and consume
commit-slab.h +1 -1
@@ -22,7 +22,7 @@* * Initializes the indegree slab that associates an array of integers * to each commit. 'stride' specifies how big each array is. The slab -* that id initialied by the variant without "_with_stride" associates +* that id initialized by the variant without "_with_stride" associates * each commit with an array of one integer. */
compat/nedmalloc/malloc.c.h +4 -4
@@ -1558,7 +1558,7 @@ static FORCEINLINE void* win32direct_mmap(size_t size) {return (ptr !=0 )? ptr:MFAIL ; } -/* This function supports releasing coalesed segments */ +/* This function supports releasing coalesced segments */ static FORCEINLINE int win32munmap(void* ptr, size_t size) {MEMORY_BASIC_INFORMATION minfo;char * cptr = (char *)ptr;
@@ -2478,7 +2478,7 @@ typedef struct malloc_segment* msegmentptr; Trim support Fields holding the amount of unused topmost memory that should trigger - timming, and a counter to force periodic scanning to release unused + trimming, and a counter to force periodic scanning to release unused non-topmost segments. Locking
@@ -3602,8 +3602,8 @@ static void internal_malloc_stats(mstate m) { and choose its bk node as its replacement. 2. If x was the last node of its size, but not a leaf node, it must be replaced with a leaf node (not merely one with an open left or - right), to make sure that lefts and rights of descendents - correspond properly to bit masks. We use the rightmost descendent + right), to make sure that lefts and rights of descendants + correspond properly to bit masks. We use the rightmost descendant of x. We could use any other leaf, but this is easy to locate and tends to counteract removal of leftmosts elsewhere, and so keeps paths shorter than minimally guaranteed. This doesn't loop much
compat/obstack.h +1 -1
@@ -80,7 +80,7 @@ change its address during its lifetime. When the chars burst over a chunk boundary, we allocate a larger chunk, and then copy the partly formed object from the end of the old chunk to the beginning of the new larger chunk. We then carry on -accreting characters to the end of the object as we normally would. +accrediting characters to the end of the object as we normally would. A special macro is provided to add a single char at a time to a growing object. This allows the use of register variables, which
compat/poll/poll.h +1 -1
@@ -25,7 +25,7 @@/* fake a poll(2) environment */ #define POLLIN 0x0001/* any readable data available */ #define POLLPRI 0x0002/* OOB/Urgent readable data */ -#define POLLOUT 0x0004/* file descriptor is writeable */ +#define POLLOUT 0x0004/* file descriptor is writable */ #define POLLERR 0x0008/* some poll error occurred */ #define POLLHUP 0x0010/* file descriptor was "hung up" */ #define POLLNVAL 0x0020/* requested events "invalid" */
compat/precompose_utf8.c +1 -1
@@ -148,7 +148,7 @@ struct dirent_prec_psx *precompose_utf8_readdir(PREC_DIR *prec_dir)if (errno || inleft) {/* * iconv() failed and errno could be E2BIG, EILSEQ, EINVAL, EBADF -* MacOS X avoids illegal byte sequemces. +* MacOS X avoids illegal byte sequences. * If they occur on a mounted drive (e.g. NFS) it is not worth to * die() for that, but rather let the user see the original name */
compat/regex/regcomp.c +4 -4
@@ -2788,7 +2788,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,const int32_t *symb_table;const unsigned char *extra; -/* Local function for parse_bracket_exp used in _LIBC environement. +/* Local function for parse_bracket_exp used in _LIBC environment. Seek the collating symbol entry correspondings to NAME. Return the index of the symbol in the SYMB_TABLE. */
@@ -2892,7 +2892,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,return UINT_MAX ; } -/* Local function for parse_bracket_exp used in _LIBC environement. +/* Local function for parse_bracket_exp used in _LIBC environment. Build the range expression which starts from START_ELEM, and ends at END_ELEM. The result are written to MBCSET and SBCSET. RANGE_ALLOC is the allocated size of mbcset->range_starts, and
@@ -2976,7 +2976,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,return REG_NOERROR ; } -/* Local function for parse_bracket_exp used in _LIBC environement. +/* Local function for parse_bracket_exp used in _LIBC environment. Build the collating element which is represented by NAME. The result are written to MBCSET and SBCSET. COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
@@ -3455,7 +3455,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)/* This isn't a valid character. */ return REG_ECOLLATE ; -/* Build single byte matcing table for this equivalence class. */ +/* Build single byte matching table for this equivalence class. */ char_buf[1 ] = (unsigned char )'\0' ; len = weights[idx1 &0xffffff ];for (ch =0 ; ch <SBC_MAX ; ++ch)
compat/regex/regexec.c +2 -2
@@ -2421,7 +2421,7 @@ find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)/* From the node set CUR_NODES, pick up the nodes whose types are OP_OPEN_SUBEXP and which have corresponding back references in the regular expression. And register them to use them later for evaluating the -correspoding back references. */ +corresponding back references. */ static reg_errcode_t internal_function
@@ -3348,7 +3348,7 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state) dests_node = dests_alloc->dests_node; dests_ch = dests_alloc->dests_ch; -/* Initialize transiton table. */ +/* Initialize transition table. */ state->word_trtable = state->trtable =NULL ;/* At first, group all nodes belonging to `state' into several
convert.c +1 -1
@@ -835,7 +835,7 @@ int renormalize_buffer(const char *path, const char *src, size_t len, struct str/***************************************************************** * -* Streaming converison support +* Streaming conversion support * *****************************************************************/
convert.h +1 -1
@@ -48,7 +48,7 @@ static inline int would_convert_to_git(const char *path, const char *src,/***************************************************************** * -* Streaming converison support +* Streaming conversion support * *****************************************************************/
diff-no-index.c +1 -1
@@ -208,7 +208,7 @@ void diff_no_index(struct rev_info *revs,* when a path outside the repository is given, * e.g. "git diff /var/tmp/[12]", or "git diff * Makefile /var/tmp/Makefile", allow it to be used as -* a colourful "diff" replacement. +* a colorful "diff" replacement. */ if ((argc != i + 2) || (path_inside_repo(prefix, argv[i]) &&
diff.c +2 -2
@@ -1396,7 +1396,7 @@ static int scale_linear(int it, int width, int max_change)/* * make sure that at least one '-' or '+' is printed if * there is any change to this path. The easiest way is to -* scale linearly as if the alloted width is one column shorter +* scale linearly as if the allocated width is one column shorter * than it is, and then add 1 to the result. */ return 1 + (it * (width -1 ) / max_change);
@@ -4460,7 +4460,7 @@ void diff_flush(struct diff_options *options) DIFF_OPT_TST(options, DIFF_FROM_CONTENTS)) {/* * run diff_flush_patch for the exit status. setting -* options->file to /dev/null should be safe, becaue we +* options->file to /dev/null should be safe, because we * aren't supposed to produce any output anyway. */ if (options->close_file)
kwset.c +5 -5
@@ -65,7 +65,7 @@ struct triestruct trie *fail;/* Aho-Corasick failure function. */ int depth;/* Depth of this node from the root. */ int shift;/* Shift function for search failures. */ -int maxshift;/* Max shift of self and descendents. */ +int maxshift;/* Max shift of self and descendants. */ };/* Structure returned opaquely to the caller, containing everything. */
@@ -308,7 +308,7 @@ treefails (register struct tree const *tree, struct trie const *fail,treefails (tree->rlink, fail, recourse);/* Find, in the chain of fails going back to the root, the first -node that has a descendent on the current label. */ +node that has a descendant on the current label. */ while (fail) { link = fail->links;
@@ -426,13 +426,13 @@ kwsprep (kwset_t kws)computing the delta table, failure function, and shift function. */ for (curr = last = kwset->trie; curr; curr = curr->next) { -/* Enqueue the immediate descendents in the level order queue. */ +/* Enqueue the immediate descendants in the level order queue. */ enqueue (curr->links, &last); curr->shift = kwset->mind; curr->maxshift = kwset->mind; -/* Update the delta table for the descendents of this node. */ +/* Update the delta table for the descendants of this node. */ treedelta (curr->links, curr->depth, delta);/* Compute the failure function for the descendants of this node. */
@@ -450,7 +450,7 @@ kwsprep (kwset_t kws) fail->shift = curr->depth - fail->depth;/* If the current node is accepting then the shift at the -fail and its descendents should be no larger than the +fail and its descendants should be no larger than the difference of their depths. */ if (curr->accepting && fail->maxshift > curr->depth - fail->depth) fail->maxshift = curr->depth - fail->depth;
notes.h +4 -4
@@ -64,9 +64,9 @@ extern struct notes_tree {const char *default_notes_ref (void );/* -* Flags controlling behaviour of notes tree initialization +* Flags controlling behavior of notes tree initialization * -* Default behaviour is to initialize the notes tree from the tree object +* Default behavior is to initialize the notes tree from the tree object * specified by the given (or default) notes ref. */ #define NOTES_INIT_EMPTY 1
@@ -152,9 +152,9 @@ int copy_note(struct notes_tree *t, int force, combine_notes_fn combine_notes);/* -* Flags controlling behaviour of for_each_note() +* Flags controlling behavior of for_each_note() * -* Default behaviour of for_each_note() is to traverse every single note object +* Default behavior of for_each_note() is to traverse every single note object * in the given notes tree, unpacking subtree entries along the way. * The following flags can be used to alter the default behaviour: *
read-cache.c +1 -1
@@ -489,7 +489,7 @@ int remove_index_entry_at(struct index_state *istate, int pos) }/* -* Remove all cache ententries marked for removal, that is where +* Remove all cache entries marked for removal, that is where * CE_REMOVE is set in ce_flags. This is much more effective than * calling remove_index_entry_at() for each entry to be removed. */
refs.h +1 -1
@@ -105,7 +105,7 @@ extern int commit_packed_refs(void);extern void rollback_packed_refs (void );/* -* Flags for controlling behaviour of pack_refs() +* Flags for controlling behavior of pack_refs() * PACK_REFS_PRUNE: Prune loose refs after packing * PACK_REFS_ALL: Pack _all_ refs, not just tags and already packed refs */
revision.c +1 -1
@@ -1944,7 +1944,7 @@ static int handle_revision_pseudo_opt(const char *submodule,* NOTE! * * Commands like "git shortlog" will not accept the options below -* unless parse_revision_opt queues them (as opposed to erroring +* unless parse_revision_opt queues them (as opposed to erring * out). * * When implementing your new pseudo-option, remember to
sha1_name.c +1 -1
@@ -52,7 +52,7 @@ static void update_candidates(struct disambiguate_state *ds, const unsigned char }if (!ds->candidate_ok) { -/* discard the candidate; we know it does not satisify fn */ +/* discard the candidate; we know it does not satisfy fn */ hashcpy (ds->candidate, current); ds->candidate_checked =0 ;return ;
transport-helper.c +2 -2
@@ -1131,7 +1131,7 @@ static void *udt_copy_task_routine(void *udt)#ifndef NO_PTHREADS /* -* Join thread, with apporiate errors on failure. Name is name for the +* Join thread, with appropriate errors on failure. Name is name for the * thread (for error messages). Returns 0 on success, 1 on failure. */ static int tloop_join (pthread_t thread,const char *name)
@@ -1197,7 +1197,7 @@ static void udt_kill_transfer(struct unidirectional_transfer *t) }/* -* Join process, with apporiate errors on failure. Name is name for the +* Join process, with appropriate errors on failure. Name is name for the * process (for error messages). Returns 0 on success, 1 on failure. */ static int tloop_join (pid_t pid,const char *name)
write_or_die.c +1 -1
@@ -13,7 +13,7 @@ static void check_pipe(int err)/* * Some cases use stdio, but want to flush after the write * to get error handling (and to get better interactive -* behaviour - not buffering excessively). +* behavior - not buffering excessively). * * Of course, if the flush happened within the write itself, * we've already lost the error code, and cannot report it any
xdiff/xprepare.c +1 -1
@@ -379,7 +379,7 @@ static int xdl_clean_mmatch(char const *dis, long i, long s, long e) {/* * Try to reduce the problem complexity, discard records that have no * matches on the other file. Also, lines that have multiple matches -* might be potentially discarded if they happear in a run of discardable. +* might be potentially discarded if they appear in a run of discardable. */ static int xdl_cleanup_records (xdlclassifier_t *cf,xdfile_t *xdf1,xdfile_t *xdf2) {long i, nm, nreff, mlim;
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] Fix typos in comments
Quoted 3 lines · Ondřej Bílka
A dictionary that I generated is following, patch is below.
alloted allocated
"allotted" is a valid word, and I think it would work fine in the code. It's probably what was intended, anyway.
Quoted 3 lines
behaviour behavior
colourful colorful
initialised initialized
I'm not sure whether git has a standard for which dialect of English is to be used, but the three words on the left are considered correct in most non-American dialects. Characterizing them as "typos" isn't strictly correct. Perhaps "Convert comments to American English" is more accurate?
Signature · 3 lines
brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
American or British English?
Quoted 8 lines · brian m. carlson
Quoted 3 lines · Ondřej Bílka
A dictionary that I generated is following, patch is below.
alloted allocated
"allotted" is a valid word, and I think it would work fine in the code. It's probably what was intended, anyway.
OK, I am not native speaker so I sometimes choose simpler variant.
Quoted 10 lines
Quoted 3 lines
behaviour behavior
colourful colorful
initialised initializedI'm not sure whether git has a standard for which dialect of English is to be used, but the three words on the left are considered correct in most non-American dialects. Characterizing them as "typos" isn't strictly correct. Perhaps "Convert comments to American English" is more accurate?
Yeah, on most projects I seen preference for consistently using American versions. How you decide is matter of preference.
Quoted 4 lines
Signature · 3 lines
brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Re: [PATCH 2/2] Fix typos in comments
In reply to Ondřej BílkaQuoted 1 line · Ondřej Bílka
A dictionary that I generated is following, patch is below.
Please use only "obvious and clear typo nobody would disagree with the fix" entries and drop other entries in the "I would prefer to use a different phrasing or spelling" category. For example, as already mentioned, "alloted" is a proper pp of a verb, so it falls into the latter.
Thanks.
Re: [PATCH 2/2] Fix typos in comments
In reply to Ondřej Bílkabuiltin/checkout.c int cmd_checkout(int argc, const char **argv, const char *prefix) · line 1140
Quoted 10 lines · Ondřej Bílka
builtin/checkout.c +1
-1@@ -1137,7 +1137,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)* 3) git checkout <something> [<paths>] * * including "last branch" syntax and DWIM-ery for names of -* remote branches, erroring out for invalid or ambiguous cases. +* remote branches, erring out for invalid or ambiguous cases.
Didn't look through the entire patch, but this caught me eye: what's wrong with "erroring out"?
Re: [PATCH 2/2] Fix typos in comments
Quoted 14 lines · Ramkumar Ramachandra
builtin/checkout.c int cmd_checkout(int argc, const char **argv, const char *prefix) · line 1140
Quoted 10 lines · Ondřej Bílka
builtin/checkout.c +1
-1@@ -1137,7 +1137,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)* 3) git checkout <something> [<paths>] * * including "last branch" syntax and DWIM-ery for names of -* remote branches, erroring out for invalid or ambiguous cases. +* remote branches, erring out for invalid or ambiguous cases. Didn't look through the entire patch, but this caught me eye: what's wrong with "erroring out"?
Well aspell did not know it so I thought that erring is more appropriate. Now it looks more murky, see
http://english.stackexchange.com/questions/3059/is-errored-correct-usage
I am ok with removing this correction.
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Ondřej Bílka
Hi, I wrote a tool that effectively fixes typos in comments and only in comments.
It can be downloaded here:https://github.com/neleai/stylepp
For typos you need identify them, write replacement dictionary and run STYLEPP/script/stylepp_skeleton
stylepp_fix_commentHere generic dictionary is used that was taken from wikipedia.
https://github.com/neleai/stylepp/blob/master/maintained/dictionary_wiki
Thanks, but sorry we cannot use this patch as-is (even if it were signed-off and came with a proper log message).
The patch touches phrases somebody may find questionable at many different levels.
- "lowercase ok" and "fall thru" are quite acceptable colloquial forms; if the person who DID the real work chose to write these in such a way, I do not see a reason for us to update it to a different preference.
- There are outright typoes that noboddy would disagree with, e.g. s/sinse/since/.