summaryrefslogtreecommitdiff
path: root/builtin/commit.c
Commit message (Collapse)AuthorAgeFilesLines
* replace {pre,suf}fixcmp() with {starts,ends}_with()cc/starts-n-ends-withChristian Couder2013-12-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Leaving only the function definitions and declarations so that any new topic in flight can still make use of the old functions, replace existing uses of the prefixcmp() and suffixcmp() with new API functions. The change can be recreated by mechanically applying this: $ git grep -l -e prefixcmp -e suffixcmp -- \*.c | grep -v strbuf\\.c | xargs perl -pi -e ' s|!prefixcmp\(|starts_with\(|g; s|prefixcmp\(|!starts_with\(|g; s|!suffixcmp\(|ends_with\(|g; s|suffixcmp\(|!ends_with\(|g; ' on the result of preparatory changes in this series. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'mm/commit-template-squelch-advice-messages'Junio C Hamano2013-09-201-8/+17
|\ | | | | | | | | | | | | | | | | | | From the commit log template, remove irrelevant "advice" messages that are shared with "git status" output. * mm/commit-template-squelch-advice-messages: commit: disable status hints when writing to COMMIT_EDITMSG wt-status: turn advice_status_hints into a field of wt_status commit: factor status configuration is a helper function
| * commit: disable status hints when writing to COMMIT_EDITMSGmm/commit-template-squelch-advice-messagesMatthieu Moy2013-09-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This turns the template COMMIT_EDITMSG from e.g # [...] # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: builtin/commit.c # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # t/foo # to # [...] # Changes to be committed: # modified: builtin/commit.c # # Untracked files: # t/foo # Most status hints were written to be accurate when running "git status" before running a commit. Many of them are not applicable when the commit has already been started, and should not be shown in COMMIT_EDITMSG. The most obvious are hints advising to run "git commit", "git rebase/am/cherry-pick --continue", which do not make sense when the command has already been run. Other messages become slightly inaccurate (e.g. hint to use "git add" to add untracked files), as the suggested commands are not immediately applicable during the editing of COMMIT_EDITMSG, but would be applicable if the commit is aborted. These messages are both potentially helpful and slightly misleading. This patch chose to remove them too, to avoid introducing too much complexity in the status code. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * wt-status: turn advice_status_hints into a field of wt_statusMatthieu Moy2013-09-121-0/+1
| | | | | | | | | | | | | | | | | | No behavior change in this patch, but this makes the display of status hints more flexible as they can be enabled or disabled for individual calls to commit.c:run_status(). Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * commit: factor status configuration is a helper functionMatthieu Moy2013-09-121-8/+10
| | | | | | | | | | | | | | | | | | cmd_commit and cmd_status use very similar code to initialize the wt_status structure. Factor this code into a function to ensure future changes will keep both versions consistent. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'bk/refs-multi-update'Junio C Hamano2013-09-201-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give "update-refs" a "--stdin" option to read multiple update requests and perform them in an all-or-none fashion. * bk/refs-multi-update: update-ref: add test cases covering --stdin signature update-ref: support multiple simultaneous updates refs: add update_refs for multiple simultaneous updates refs: add function to repack without multiple refs refs: factor delete_ref loose ref step into a helper refs: factor update_ref steps into helpers refs: report ref type from lock_any_ref_for_update reset: rename update_refs to reset_refs
| * | refs: report ref type from lock_any_ref_for_updateBrad King2013-08-301-1/+1
| |/ | | | | | | | | | | | | | | | | Expose lock_ref_sha1_basic's type_p argument to callers of lock_any_ref_for_update. Update all call sites to ignore it by passing NULL for now. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'mm/status-without-comment-char'Junio C Hamano2013-09-201-0/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git status" now omits the prefix to make its output a comment in a commit log editor, which is not necessary for human consumption. We may want to tighten the output to omit unnecessary trailing blank lines, but that does not have to be in the scope of this series. * mm/status-without-comment-char: t7508: avoid non-portable sed expression status: add missing blank line after list of "other" files tests: don't set status.displayCommentPrefix file-wide status: disable display of '#' comment prefix by default submodule summary: ignore --for-status option wt-status: use argv_array API builtin/stripspace.c: fix broken indentation
| * | status: disable display of '#' comment prefix by defaultMatthieu Moy2013-09-061-0/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically, "git status" needed to prefix each output line with '#' so that the output could be added as comment to the commit message. This prefix comment has no real purpose when "git status" is ran from the command-line, and this may distract users from the real content. Disable this prefix comment by default, and make it re-activable for users needing backward compatibility with status.displayCommentPrefix. Obviously, "git commit" ignores status.displayCommentPrefix and keeps the comment unconditionnaly when writing to COMMIT_EDITMSG (but not when writing to stdout for an error message or with --dry-run). Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ap/commit-author-mailmap'Junio C Hamano2013-09-171-1/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | "git commit --author=$name", when $name is not in the canonical "A. U. Thor <au.thor@example.xz>" format, looks for a matching name from existing history, but did not consult mailmap to grab the preferred author name. * ap/commit-author-mailmap: commit: search author pattern against mailmap
| * | commit: search author pattern against mailmapap/commit-author-mailmapAntoine Pelisse2013-08-241-1/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | "git commit --author=$name" sets the author to one whose name matches the given string from existing commits, when $name is not in the "Name <e-mail>" format. However, it does not honor the mailmap to use the canonical name for the author found this way. Fix it by telling the logic to find a matching existing author to honor the mailmap, and use the name and email after applying the mailmap. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jl/submodule-mv'Junio C Hamano2013-09-091-19/+18
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git mv A B" when moving a submodule A does "the right thing", inclusing relocating its working tree and adjusting the paths in the .gitmodules file. * jl/submodule-mv: (53 commits) rm: delete .gitmodules entry of submodules removed from the work tree mv: update the path entry in .gitmodules for moved submodules submodule.c: add .gitmodules staging helper functions mv: move submodules using a gitfile mv: move submodules together with their work trees rm: do not set a variable twice without intermediate reading. t6131 - skip tests if on case-insensitive file system parse_pathspec: accept :(icase)path syntax pathspec: support :(glob) syntax pathspec: make --literal-pathspecs disable pathspec magic pathspec: support :(literal) syntax for noglob pathspec kill limit_pathspec_to_literal() as it's only used by parse_pathspec() parse_pathspec: preserve prefix length via PATHSPEC_PREFIX_ORIGIN parse_pathspec: make sure the prefix part is wildcard-free rename field "raw" to "_raw" in struct pathspec tree-diff: remove the use of pathspec's raw[] in follow-rename codepath remove match_pathspec() in favor of match_pathspec_depth() remove init_pathspec() in favor of parse_pathspec() remove diff_tree_{setup,release}_paths convert common_prefix() to use struct pathspec ...
| * | convert common_prefix() to use struct pathspecNguyễn Thái Ngọc Duy2013-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | The code now takes advantage of nowildcard_len field. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | convert add_files_to_cache to take struct pathspecNguyễn Thái Ngọc Duy2013-07-151-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | convert refresh_index to take struct pathspecNguyễn Thái Ngọc Duy2013-07-151-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | convert report_path_error to take struct pathspecNguyễn Thái Ngọc Duy2013-07-151-8/+6
| | | | | | | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | convert read_cache_preload() to take struct pathspecNguyễn Thái Ngọc Duy2013-07-151-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | status: convert to use parse_pathspecNguyễn Thái Ngọc Duy2013-07-151-4/+5
| | | | | | | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | commit: convert to use parse_pathspecNguyễn Thái Ngọc Duy2013-07-151-9/+9
| | | | | | | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'sb/parseopt-boolean-removal'Junio C Hamano2013-09-041-25/+23
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert most uses of OPT_BOOLEAN/OPTION_BOOLEAN that can use OPT_BOOL/OPTION_BOOLEAN which have much saner semantics, and turn remaining ones into OPT_SET_INT, OPT_COUNTUP, etc. as necessary. * sb/parseopt-boolean-removal: revert: use the OPT_CMDMODE for parsing, reducing code checkout-index: fix negations of even numbers of -n config parsing options: allow one flag multiple times hash-object: replace stdin parsing OPT_BOOLEAN by OPT_COUNTUP branch, commit, name-rev: ease up boolean conditions checkout: remove superfluous local variable log, format-patch: parsing uses OPT__QUIET Replace deprecated OPT_BOOLEAN by OPT_BOOL Remove deprecated OPTION_BOOLEAN for parsing arguments
| * | branch, commit, name-rev: ease up boolean conditionsStefan Beller2013-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the variables are set by OPT_BOOL, which makes sure to have the values being 0 or 1 after parsing, we do not need the double negation to map any other value to 1 for integer variables. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Replace deprecated OPT_BOOLEAN by OPT_BOOLStefan Beller2013-08-051-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This task emerged from b04ba2bb (parse-options: deprecate OPT_BOOLEAN, 2011-09-27). All occurrences of the respective variables have been reviewed and none of them relied on the counting up mechanism, but all of them were using the variable as a true boolean. This patch does not change semantics of any command intentionally. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Remove deprecated OPTION_BOOLEAN for parsing argumentsStefan Beller2013-08-051-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of b04ba2bb4 OPTION_BOOLEAN was deprecated. This commit removes all occurrences of OPTION_BOOLEAN. In b04ba2bb4 Junio suggested to replace it with either OPTION_SET_INT or OPTION_COUNTUP instead. However a pattern, which occurred often with the OPTION_BOOLEAN was a hidden boolean parameter. So I defined OPT_HIDDEN_BOOL as an additional possible parse option in parse-options.h to make life easy. The OPT_HIDDEN_BOOL was used in checkout, clone, commit, show-ref. The only exception, where there was need to fiddle with OPTION_SET_INT was log and notes. However in these two files there is also a pattern, so we could think of introducing OPT_NONEG_BOOL. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jk/commit-how-to-abort-cherry-pick'Junio C Hamano2013-07-311-3/+22
|\ \ \ | |/ / |/| | | | | | | | * jk/commit-how-to-abort-cherry-pick: commit: tweak empty cherry pick advice for sequencer
| * | commit: tweak empty cherry pick advice for sequencerjk/commit-how-to-abort-cherry-pickJeff King2013-07-291-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we refuse to make an empty commit, we check whether we are in a cherry-pick in order to give better advice on how to proceed. We instruct the user to repeat the commit with "--allow-empty" to force the commit, or to use "git reset" to skip it and abort the cherry-pick. In the case of a single cherry-pick, the distinction between skipping and aborting is not important, as there is no more work to be done afterwards. When we are using the sequencer to cherry pick a series of commits, though, the instruction is confusing: does it skip this commit, or does it abort the rest of the cherry-pick? It does skip, after which the user can continue the cherry-pick. This is the right thing to be advising the user to do, but let's make it more clear what will happen, both by using the word "skip", and by mentioning that the rest of the sequence can be continued via "cherry-pick --continue" (whether we skip or take the commit). Noticed-by: Ramkumar Ramachandra <artagnon@gmail.com> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'sb/misc-fixes'Junio C Hamano2013-07-241-1/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assorted code cleanups and a minor fix. * sb/misc-fixes: diff.c: Do not initialize a variable, which gets reassigned anyway. commit: Fix a memory leak in determine_author_info daemon.c:handle: Remove unneeded check for null pointer.
| * | | commit: Fix a memory leak in determine_author_infoStefan Beller2013-07-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The date variable is assigned new memory via xmemdupz and 2 lines later it is assigned new memory again via xmalloc, but the first assignment is never freed nor used. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'nd/const-struct-cache-entry'Junio C Hamano2013-07-221-1/+1
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | * nd/const-struct-cache-entry: Convert "struct cache_entry *" to "const ..." wherever possible
| * | | Convert "struct cache_entry *" to "const ..." wherever possiblend/const-struct-cache-entryNguyễn Thái Ngọc Duy2013-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I attempted to make index_state->cache[] a "const struct cache_entry **" to find out how existing entries in index are modified and where. The question I have is what do we do if we really need to keep track of on-disk changes in the index. The result is - diff-lib.c: setting CE_UPTODATE - name-hash.c: setting CE_HASHED - preload-index.c, read-cache.c, unpack-trees.c and builtin/update-index: obvious - entry.c: write_entry() may refresh the checked out entry via fill_stat_cache_info(). This causes "non-const struct cache_entry *" in builtin/apply.c, builtin/checkout-index.c and builtin/checkout.c - builtin/ls-files.c: --with-tree changes stagemask and may set CE_UPDATE Of these, write_entry() and its call sites are probably most interesting because it modifies on-disk info. But this is stat info and can be retrieved via refresh, at least for porcelain commands. Other just uses ce_flags for local purposes. So, keeping track of "dirty" entries is just a matter of setting a flag in index modification functions exposed by read-cache.c. Except unpack-trees, the rest of the code base does not do anything funny behind read-cache's back. The actual patch is less valueable than the summary above. But if anyone wants to re-identify the above sites. Applying this patch, then this: diff --git a/cache.h b/cache.h index 430d021..1692891 100644 --- a/cache.h +++ b/cache.h @@ -267,7 +267,7 @@ static inline unsigned int canon_mode(unsigned int mode) #define cache_entry_size(len) (offsetof(struct cache_entry,name) + (len) + 1) struct index_state { - struct cache_entry **cache; + const struct cache_entry **cache; unsigned int version; unsigned int cache_nr, cache_alloc, cache_changed; struct string_list *resolve_undo; will help quickly identify them without bogus warnings. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jg/status-config'Junio C Hamano2013-07-111-19/+64
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git status" learned status.branch and status.short configuration variables to use --branch and --short options by default (override with --no-branch and --no-short options from the command line). * jg/status-config: status/commit: make sure --porcelain is not affected by user-facing config commit: make it work with status.short status: introduce status.branch to enable --branch by default status: introduce status.short to enable --short by default
| * | | status/commit: make sure --porcelain is not affected by user-facing configJunio C Hamano2013-06-241-22/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent addition of status.branch started affecting what is shown when "git status --porcelain" is run by mistake. Identify the configuration items that should be ignored under "--porcelain" option, introduce a "deferred config" mechanism to keep the values read from the configuration, and decide what value to use only after we read both from configuration and command line. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | commit: make it work with status.shortRamkumar Ramachandra2013-06-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With "status.short" set, it is now impossible to commit with status.short set, because it acts like "git commit --short", and it is impossible to differentiate between a status_format set by the command-line option parser versus that set by the config parser. To alleviate this problem, clear status_format as soon as the config parser has finished its work. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | status: introduce status.branch to enable --branch by defaultJorge Juan Garcia Garcia2013-06-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some people often run 'git status -b'. The config variable status.branch allows to set it by default. Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr> Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr> Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | status: introduce status.short to enable --short by defaultJorge Juan Garcia Garcia2013-06-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some people always run 'git status -s'. The configuration variable status.short allows to set it by default. Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr> Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr> Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jh/libify-note-handling'Junio C Hamano2013-06-241-1/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to call into copy-notes API from the sequencer code. * jh/libify-note-handling: Move create_notes_commit() from notes-merge.c into notes-utils.c Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.c finish_copy_notes_for_rewrite(): Let caller provide commit message
| * | | | Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.cJohan Herland2013-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a pure code movement of the machinery for copying notes to rewritten objects. This code was located in builtin/notes.c for historical reasons. In order to make it available to builtin/commit.c it was declared in builtin.h. This was more of an accident of history than a concious design, and we now want to make this machinery more widely available. Hence, this patch moves the code into the new notes-utils.[hc] files which are included into libgit.a. Except for adjusting #includes accordingly, this patch merely moves the relevant functions verbatim into the new files. Cc: Thomas Rast <trast@inf.ethz.ch> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | finish_copy_notes_for_rewrite(): Let caller provide commit messageJohan Herland2013-06-121-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When copying notes for a rewritten object, the resulting notes commit would have the following hardcoded commit message: Notes added by 'git notes copy' This is obviously bogus when the notes rewriting is performed by 'git commit --amend'. Therefore, let the caller specify an appropriate notes commit message instead of hardcoding it. The above message is used for 'git notes copy', but when calling finish_copy_notes_for_rewrite() from builtin/commit.c, we use the following message instead: Notes added by 'git commit --amend' Cc: Thomas Rast <trast@inf.ethz.ch> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Revert "Merge branch 'jg/status-config'"Junio C Hamano2013-06-241-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1a22bd31f0a5130ce6c934951a5526ceb774c2be, reversing changes made to 3e7a5b489e45ae8a3a0b222893d58b172d883136. It makes it impossible to "git commit" when status.short is set, and also "git status --porcelain" output is affected by status.branch.
* | | | Merge branch 'jg/status-config'Junio C Hamano2013-06-231-0/+11
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git status" learned status.branch and status.short configuration variables to use --branch and --short options by default (override with --no-branch and --no-short options from the command line). * jg/status-config: status: introduce status.branch to enable --branch by default status: introduce status.short to enable --short by default
| * | | | status: introduce status.branch to enable --branch by defaultJorge Juan Garcia Garcia2013-06-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some people often run 'git status -b'. The config variable status.branch allows to set it by default. Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr> Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr> Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | status: introduce status.short to enable --short by defaultJorge Juan Garcia Garcia2013-06-111-0/+7
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some people always run 'git status -s'. The configuration variable status.short allows to set it by default. Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr> Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr> Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'rs/commit-m-no-edit'Junio C Hamano2013-06-051-4/+6
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | "git commit --allow-empty-message -m ''" should not start an editor. * rs/commit-m-no-edit: commit: don't start editor if empty message is given with -m
| * | | commit: don't start editor if empty message is given with -mRené Scharfe2013-05-281-4/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an empty message is specified with the option -m of git commit then the editor is started. That's unexpected and unnecessary. Instead of using the length of the message string for checking if the user specified one, directly remember if the option -m was given. Reported-by: Mislav Marohnić <mislav.marohnic@gmail.com> Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | pretty: save commit encoding from logmsg_reencode if the caller needs itNguyễn Thái Ngọc Duy2013-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit encoding is parsed by logmsg_reencode, there's no need for the caller to re-parse it again. The reencoded message now has the new encoding, not the original one. The caller would need to read commit object again before parsing. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'bc/append-signed-off-by'Junio C Hamano2013-04-011-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consolidate codepaths that inspect log-message-to-be and decide to add a new Signed-off-by line in various commands. * bc/append-signed-off-by: git-commit: populate the edit buffer with 2 blank lines before s-o-b Unify appending signoff in format-patch, commit and sequencer format-patch: update append_signoff prototype t4014: more tests about appending s-o-b lines sequencer.c: teach append_signoff to avoid adding a duplicate newline sequencer.c: teach append_signoff how to detect duplicate s-o-b sequencer.c: always separate "(cherry picked from" from commit body sequencer.c: require a conforming footer to be preceded by a blank line sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer t/t3511: add some tests of 'cherry-pick -s' functionality t/test-lib-functions.sh: allow to specify the tag name to test_commit commit, cherry-pick -s: remove broken support for multiline rfc2822 fields sequencer.c: rework search for start of footer to improve clarity
| * | sequencer.c: teach append_signoff how to detect duplicate s-o-bBrandon Casey2013-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach append_signoff how to detect a duplicate s-o-b in the commit footer. This is in preparation to unify the append_signoff implementations in log-tree.c and sequencer.c. Fixes test in t3511. Signed-off-by: Brandon Casey <bcasey@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | git-commit: only append a newline to -m mesg if necessaryBrandon Casey2013-02-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, git will append two newlines to every message supplied via the -m switch. The purpose of this is to allow -m to be supplied multiple times and have each supplied string become a paragraph in the resulting commit message. Normally, this does not cause a problem since any trailing newlines will be removed by the cleanup operation. If cleanup=verbatim for example, then the trailing newlines will not be removed and will survive into the resulting commit message. Instead, let's ensure that the string supplied to -m is newline terminated, but only append a second newline when appending additional messages. Fixes the test in t7502. Signed-off-by: Brandon Casey <drafnel@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint'Junio C Hamano2013-02-121-2/+2
|\ \ \ | | | | | | | | | | | | | | | | * maint: Replace filepattern with pathspec for consistency
| * | | Replace filepattern with pathspec for consistencyMatthieu Moy2013-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pathspec is the most widely used term, and is the one defined in gitglossary.txt. <filepattern> was used only in the synopsys for git-add and git-commit, and in git-add.txt. Get rid of it. This patch is obtained with by running: perl -pi -e 's/filepattern/pathspec/' `git grep -l filepattern` Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jk/read-commit-buffer-data-after-free'Junio C Hamano2013-02-041-12/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarify the ownership rule for commit->buffer field, which some callers incorrectly accessed without making sure it is populated. * jk/read-commit-buffer-data-after-free: logmsg_reencode: lazily load missing commit buffers logmsg_reencode: never return NULL commit: drop useless xstrdup of commit message