- 12 5月, 2008 1 次提交
-
-
由 Sitaram Chamarty 提交于
This makes the C code consistent with the documentation and the old shell code. Signed-off-by: NSitaram Chamarty <sitaramc@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 11 5月, 2008 1 次提交
-
-
由 Linus Torvalds 提交于
The commit sequence used to do if (file_exists(p->path)) add_file_to_cache(p->path, 0); where both "file_exists()" and "add_file_to_cache()" needed to do a lstat() on the path to do their work. This cuts down 'lstat()' calls for the partial commit case by two for each path we know about (because we do this twice per path). Just move the lstat() to the caller instead (that's all that "file_exists()" really does), and pass the stat information down to the add_to_cache() function. This essentially makes 'add_to_index()' the core function that adds a path to the index, getting the index pointer, the pathname and the stat information as arguments. There are then shorthand helper functions that use this core function: - 'add_to_cache()' is just 'add_to_index()' with the default index - 'add_file_to_cache/index()' is the same, but does the lstat() call itself, so you can pass just the pathname if you don't already have the stat information available. So old users of the 'add_file_to_xyzzy()' are essentially left unchanged, and this just exposes the more generic helper function that can take existing stat information into account. Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 07 5月, 2008 3 次提交
-
-
由 Santi Béjar 提交于
To warn the user in case he/she might be using an unintended committer identity. Signed-off-by: NSanti Béjar <sbejar@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Santi Béjar 提交于
That would help reassure anybody while committing other's changes. Signed-off-by: NSanti Béjar <sbejar@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Santi Béjar 提交于
Reorder functions definitions such that determine_author_info is defined before prepare_to_commit. No code changes. Signed-off-by: NSanti Béjar <sbejar@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 28 4月, 2008 1 次提交
-
-
由 Dan McGee 提交于
Signed-off-by: NDan McGee <dpmcgee@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 12 4月, 2008 2 次提交
-
-
由 Johannes Sixt 提交于
Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Johannes Sixt 提交于
Its documentation was removed by 6c96753d (Documentation/git-commit: rewrite to make it more end-user friendly, 2006-12-08), even though it is referenced from a few places, including builtin-commit.c (as part of the commentary in the commit message template). Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 10 4月, 2008 1 次提交
-
-
由 Junio C Hamano 提交于
This attached patch introduces a single bit "use_terminator" in "struct rev_info", which is normally false (i.e. most formats use separator semantics) but by flipping it to true, you can ask for terminator semantics just like oneline format does. The function get_commit_format(), which is what parses "--pretty=" option, now takes a pointer to "struct rev_info" and updates its commit_format and use_terminator fields. It used to return the value of type "enum cmit_fmt", but all the callers assigned it to rev->commit_format. There are only two cases the code turns use_terminator on. Obviously, the traditional oneline format (--pretty=oneline) is one of them, and the new case is --pretty=tformat:... that acts like --pretty=format:... but flips the bit on. With this, "--pretty=tformat:%H %s" acts like --pretty=oneline. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 09 3月, 2008 2 次提交
-
-
由 Linus Torvalds 提交于
We will always unpack into our own internal index, but we will take the source from wherever specified, and we will optionally write the result to a specified index (optionally, because not everybody even _wants_ any result: the index diffing really wants to just walk the tree and index in parallel). This ends up removing a fair number more lines than it adds, for the simple reason that we can now skip all the crud that tried to be oh-so-careful about maintaining our position in the index as we were traversing and modifying it. Since we don't actually modify the source index any more, we can just update the 'o->pos' pointer without worrying about whether an index entry got removed or replaced or added to. Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Linus Torvalds 提交于
This is just a very mechanical conversion, and makes everybody set it to '&the_index' before calling, but at least it makes it more explicit where we work with the index. The next stage would be to split that index usage up into a 'source' and a 'destination' index, so that we can unpack into a different index than we started out from. Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 18 2月, 2008 1 次提交
-
-
由 Matthias Kestenholz 提交于
Signed-off-by: NMatthias Kestenholz <mk@spinlock.ch> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 16 2月, 2008 1 次提交
-
-
由 Jeff King 提交于
There may still be some entries from the original index that should be discarded before we show the status. In particular, if a file was added in the index but not included in the partial commit, it would still show up in the status listing as staged for commit. Ultimately the correct fix is to keep the two states in separate index_state variables. Then we can avoid having to reload the cache from the temporary file altogether, and just point wt_status_print at the correct index. Signed-off-by: NJeff King <peff@peff.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 12 2月, 2008 2 次提交
-
-
由 Junio C Hamano 提交于
commit.template configuration expects a string value. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Gerrit Pape 提交于
After doing a merge --squash, and commit afterwards, the commit message template SQUASH_MSG in the git directory is not removed, which means that the content of SQUASH_MSG is used as default commit message for all subsequent commits. So have git commit remove the file SQUASH_MSG from the git directory upon a successful commit. The problem was discovered by Frédéric Brière, reported through http://bugs.debian.org/464656Signed-off-by: NGerrit Pape <pape@smarden.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 10 2月, 2008 1 次提交
-
-
由 Daniel Barkalow 提交于
Return an error from unpack_trees() instead of calling die(), and exit with an error in read-tree, builtin-commit, and diff-lib. merge-recursive already expected an error return from unpack_trees, so it doesn't need to be changed. The merge function can return negative to abort. This will be used in builtin-checkout -m. Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
-
- 06 2月, 2008 4 次提交
-
-
由 Paolo Bonzini 提交于
The prepare-commit-msg hook is run whenever a "fresh" commit message is prepared, just before it is shown in the editor (if it is). Its purpose is to modify the commit message in-place. It takes one to three parameters. The first is the name of the file that the commit log message. The second is the source of the commit message, and can be: "message" (if a -m or -F option was given); "template" (if a -t option was given or the configuration option commit.template is set); "merge" (if the commit is a merge or a .git/MERGE_MSG file exists); "squash" (if a .git/SQUASH_MSG file exists); or "commit", followed by a commit SHA1 as the third parameter (if a -c, -C or --amend option was given). If its exit status is non-zero, git-commit will abort. The hook is not suppressed by the --no-verify option, so it should not be used as a replacement for the pre-commit hook. The sample prepare-commit-msg comments out the `Conflicts:` part of a merge's commit message; other examples are commented out, including adding a Signed-off-by line at the bottom of the commit messsage, that the user can then edit or discard altogether. Signed-off-by: NPaolo Bonzini <bonzini@gnu.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Paolo Bonzini 提交于
This patch moves the code of run_commit, up to writing the trees, editing the message and running the commit-msg hook to prepare_log_message. It also renames the latter to prepare_to_commit. This simplifies a little the code for the next patch. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Paolo Bonzini 提交于
This is a preparatory patch that provides a simple way for the future prepare-commit-msg hook to discover if the editor will be launched. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Paolo Bonzini 提交于
This is a preparatory patch to allow using run_hook for the prepare-commit-msg hook. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 03 2月, 2008 1 次提交
-
-
由 Junio C Hamano 提交于
The scripted version might not have handled this correctly either, but the version rewritten in C definitely does not grok this and complains $tag is not a commit object. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 24 1月, 2008 1 次提交
-
-
由 Brandon Casey 提交于
In certain rare cases, the creation of the commit object and update of HEAD can succeed, but then installing the updated index will fail. This is most likely caused by a full disk or exceeded disk quota. When this happens the new index file will be removed, and the repository will be left with the original now-out-of-sync index. The user can recover with a "git reset HEAD" once the disk space issue is resolved. We should detect this failure and offer the user some helpful guidance. Signed-off-by: NBrandon Casey <casey@nrlssc.navy.mil> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 22 1月, 2008 1 次提交
-
-
由 Linus Torvalds 提交于
This converts the index explicitly on read and write to its on-disk format, allowing the in-core format to contain more flags, and be simpler. In particular, the in-core format is now host-endian (as opposed to the on-disk one that is network endian in order to be able to be shared across machines) and as a result we can dispense with all the htonl/ntohl on accesses to the cache_entry fields. This will make it easier to make use of various temporary flags that do not exist in the on-disk format. Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 17 1月, 2008 2 次提交
-
-
由 Brandon Casey 提交于
Remove remaining double close(2)'s. i.e. close() before commit_locked_index() or commit_lock_file(). Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Linus Torvalds 提交于
When creating the commit object, be a whole lot more careful about making sure that the parent lines really are valid parent lines. Check things like MERGE_HEAD having proper SHA1 lines in it, and double-check that all the parents exist and are actually commits. Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 16 1月, 2008 1 次提交
-
-
由 Kristian Høgsberg 提交于
The codepath to prepare index files for the temporary and next index file was closing file descriptor it obtained from the lockfile API by hand, without letting the API know that the fd should not be doubly closed. This is not usually a problem (except it may get EBADFD) but if we opened another fd for an entirely unrelated purpose (say, an fd used to mmap a packfile) between the time we close the fd to the index file and the time we commit or rollback the lockfile (causing it to also try closing the recorded fd), the lockfile API will close an incorrect file descriptor that is still used for an entirely unrelated purpose. There's four close(fd) calls in prepare_index() and they're all incorrect. The open fd's are cleaned up in rollback_index_files() and shouldn't be closed manually. The patch below gets rid of the extra close() calls and should fix the problem. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 15 1月, 2008 1 次提交
-
-
由 Junio C Hamano 提交于
This reverts commit 16335fdd. We are calling overlay_tree_on_cache() which does use CE_UPDATE flag to mark duplicated entries, which is the same as the codepath in git-ls-files with its --with-tree option. Because the pathname ce->name is given to path_list_insert() which does not allow duplicates, there is no breakage either way from the correctness point of view in this codepath, unlike the one in ls-files. But avoiding unnecessary processing with a single bit check is certainly better.
-
- 14 1月, 2008 1 次提交
-
-
由 Junio C Hamano 提交于
2888605c (builtin-commit: fix partial-commit support) mindlessly cut and pasted from builtin-ls-files.c, and included a part that was meant to exclude redundant path after "ls-files --with-tree" overlayed the HEAD commit on top of the index. This logic does not apply to what git-commit does and should not have been copied, even though it would not hurt. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 13 1月, 2008 1 次提交
-
-
由 Linus Torvalds 提交于
When running "git commit paths" to create a partial commit, we used to carefully build the temporary index so that we do not lose the cached stat information. The rewrite of the command in C lost it by carelessly using read_tree(). This resurrects the earlier behaviour to keep the cached stat information as much as possible by using one-tree merge logic. Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 23 12月, 2007 3 次提交
-
-
由 Alex Riesen 提交于
Although we traditionally stripped away excess blank lines, trailing whitespaces and lines that begin with "#" from the commit log message, sometimes the message just has to be the way user wants it. For instance, a commit message template can contain lines that begin with "#", the message must be kept as close to its original source as possible if you are converting from a foreign SCM, or maybe the message has a shell script including its comments for future reference. The cleanup modes are default, verbatim, whitespace and strip. The default mode depends on if the message is being edited and will either strip whitespace and comments (if editor active) or just strip the whitespace (for where the message is given explicitely). Signed-off-by: NAlex Riesen <raa.lkml@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Junio C Hamano 提交于
The flag no_edit meant "we have got final message from the user and will not editing it any further", but there were quite a few places that needed to check !no_edit. Rename the variable to use_editor and reverse the logic everywhere. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Junio C Hamano 提交于
When amending initial commit without editor, the command incorrectly barfed because the check to see if there is anything to commit referenced the non-existent HEAD^1. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 20 12月, 2007 1 次提交
-
-
由 Junio C Hamano 提交于
The prepare_log_message() function serves two purposes: - Prepares the commit log message template, to be given to the end user; - Return true if there is something committable; 7168624c (Do not generate full commit log message if it is not going to be used) cheated to omit the former when we know the log message template is not going to be used. However, its replacement logic to see if there is something committable was botched. When amending, it should compare the index with the parent of the HEAD, not the current HEAD. Otherwise you cannot run --amend to fix only the message without changing the tree. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 17 12月, 2007 2 次提交
-
-
由 Junio C Hamano 提交于
This enables -B -M to the summary output after a commit is made so that it is in line with what is shown in git-status and commit log template. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Junio C Hamano 提交于
Because print_summary() forgot to call diff_setup_done() after futzing with diff output options, it failed to activate recursive diff, which resulted in an incorrect summary. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 15 12月, 2007 1 次提交
-
-
由 Junio C Hamano 提交于
After tentatively applying a patch from a contributor, you can get a replacement patch with corrected code and unusable commit log message. In such a case, this sequence ought to give you an editor based on the message in the earlier commit, to let you describe an incremental improvement: git reset --hard HEAD^ ;# discard the earlier one git am <corrected-patch git commit --amend -c HEAD@{1} Unfortunately, --amend insisted reusing the message from the commit being amended, ignoring the -c option. This corrects it. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 13 12月, 2007 1 次提交
-
-
由 Junio C Hamano 提交于
When recording a merge that conflicted and ends up in no changes after manual resolution, commit callchain looked like this: cmd_commit() -> prepare_log_message() -> run_status() -> wt_status_print() This invocation of run_status() is asked to find out if there is a committable change, but it unconditionally gave instructions such as "use git-add" at the same time. When in merge, we do allow an empty change to be recorded, so after showing this message the code still went ahead and made a commit. This introduces "nowarn" parameter to run_status() to avoid these useless messages. If we are not allowed to create an empty commit, we already call run_status() again in the original codepath, and the message will be shown from that call anyway. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 11 12月, 2007 1 次提交
-
-
由 Junio C Hamano 提交于
The scripted version relied on the nice "auto-strip the terminating LF" behaviour shell gives to "var=$(cmd)" construct, but we have to roll that ourselves. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 09 12月, 2007 2 次提交
-
-
由 Junio C Hamano 提交于
An earlier fix to the said commit was incomplete; it mixed up the meaning of the flag parameter passed to the internal fmt_ident() function, so this corrects it. git_author_info() and git_committer_info() can be told to issue a warning when no usable user information is found, and optionally can be told to error out. Operations that actually use the information to record a new commit or a tag will still error out, but the caller to leave reflog record will just silently use bogus user information. Not warning on misconfigured user information while writing a reflog entry is somewhat debatable, but it is probably nicer to the users to silently let it pass, because the only information you are losing is who checked out the branch. * git_author_info() and git_committer_info() used to take 1 (positive int) to error out with a warning on misconfiguration; this is now signalled with a symbolic constant IDENT_ERROR_ON_NO_NAME. * These functions used to take -1 (negative int) to warn but continue; this is now signalled with a symbolic constant IDENT_WARN_ON_NO_NAME. * fmt_ident() function implements the above error reporting behaviour common to git_author_info() and git_committer_info(). A symbolic constant IDENT_NO_DATE can be or'ed in to the flag parameter to make it return only the "Name <email@address.xz>". * fmt_name() is a thin wrapper around fmt_ident() that always passes IDENT_ERROR_ON_NO_NAME and IDENT_NO_DATE. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Junio C Hamano 提交于
The old git-commit.sh script allowed the commit-msg hook to not only prevent a commit from proceding, but also to edit the commit message on the fly and allow it to proceed. So here we teach builtin-commit to do the same. This is based on Wincent's patch, but redone with a clarified logic. Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-