summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix --signoff in builtin-commit differently.Junio C Hamano2007-12-023-14/+27
| | | | | | | | | | Introduce fmt_name() specifically meant for formatting the name and email pair, to add signed-off-by value. This reverts parts of 13208572fbe8838fd8835548d7502202d1f7b21d (builtin-commit: fix --signoff) so that an empty datestamp string given to fmt_ident() by mistake will error out as before. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-commit: clean up die messagesJeff King2007-12-011-10/+9
| | | | | | | | | | | | | | These are three types of cleanups here: 1. remove newline from die message (die/report adds it already) 2. typo: s/merger/merge/ 3. the old "* no commit message? aborting commit." is now prepended with "fatal: ", making the asterisk look a little funny. Let's just remove it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Do not generate full commit log message if it is not going to be usedAlex Riesen2007-11-281-0/+22
| | | | | | | Like when it is already specified through -C, -F or -m to git-commit. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Remove git-status from list of scripts as it is builtinShawn O. Pearce2007-11-271-1/+1
| | | | | | | | | Now that git-status is builtin on Cygwin this compiles as git-status.exe. We cannot continue to include git-status as a Makefile target as it will never be built. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix off-by-one error when truncating the diff out of the commit message.Kristian Høgsberg2007-11-261-1/+1
| | | | | Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit.c: export GIT_INDEX_FILE for launch_editor as well.Pierre Habouzit2007-11-263-7/+10
| | | | | | | | | | The editor program to let the user edit the log message used to get GIT_INDEX_FILE environment variable pointing at the right file, but this was lost when git-commit was rewritten in C. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Acked-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add a few more tests for git-commitJunio C Hamano2007-11-221-0/+92
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: Include the diff in the commit message when verbose.Kristian Høgsberg2007-11-222-1/+23
| | | | | | | | run_diff_index() and the entire diff machinery is hard coded to output to stdout, so just redirect that and restore it when done. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: fix partial-commit supportJunio C Hamano2007-11-221-40/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When making a partial-commit, we need to prepare two index files, one to be used to write out the tree to be committed (temporary index) and the other to be used as the index file after the commit is made. The temporary index needs to be initialized to HEAD and then all the named paths on the command line need to be staged on top of the index. For this, running add_files_to_cache() that compares what is in the index and the paths given from the command line is not enough -- the comparison will miss the paths that the user previously ran "git add" to the index since the HEAD because the index reset to the HEAD would not know about them. The index file needs to get the same modification done when preparing the temporary index as described above. This implementation mimics the behaviour of the scripted version of git-commit. It first runs overlay_tree_on_cache(), which was stolen from ls-files with the earlier change, to get the list of paths that the user can potentially mean, and then uses pathspec_match() to find which ones the user meant. This list of paths is used to update both the temporary and the real index file. Additional fixes are: - read the index file after pre-commit hook returns, as the hook can modify it to affect the contents of the commit. - remove the temporary index file .git/next-index-* after commit is done or aborted. - run post-commit hook with the real index file to be used after the commit (previously it gave the temporary commit if a partial commit was made). - resurrect the safety mechanism to refuse partial commits during a merge to match the scripted version. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix add_files_to_cache() to take pathspec, not user specified list of filesJunio C Hamano2007-11-223-5/+8
| | | | | | | | This separates the logic to limit the extent of change to the index by where you are (controlled by "prefix") and what you specify from the command line (controlled by "pathspec"). Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Export three helper functions from ls-filesJunio C Hamano2007-11-222-46/+58
| | | | | | | | | | | | | | | | | | | | | This exports three helper functions from ls-files. * pathspec_match() checks if a given path matches a set of pathspecs and optionally records which pathspec was used. This function used to be called "match()" but renamed to be a bit less vague. * report_path_error() takes a set of pathspecs and the record pathspec_match() above leaves, and gives error message. This was split out of the main function of ls-files. * overlay_tree_on_cache() takes a tree-ish (typically "HEAD") and overlays it on the current in-core index. By iterating over the resulting index, the caller can find out the paths in either the index or the HEAD. This function used to be called "overlay_tree()" but renamed to be a bit more descriptive. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: run commit-msg hook with correct message fileJunio C Hamano2007-11-221-1/+1
| | | | | | It should run with $GIT_DIR/COMMIT_EDITMSG, not just COMMIT_EDITMSG. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: do not color status output shown in the message templateJunio C Hamano2007-11-222-1/+5
| | | | | | Noticed by Ping Yin on the list. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* file_exists(): dangling symlinks do existJunio C Hamano2007-11-221-4/+3
| | | | | | | | | This function is used to see if a path given by the user does exist on the filesystem. A symbolic link that does not point anywhere does exist but running stat() on it would yield an error, and it incorrectly said it does not exist. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Replace "runstatus" with "status" in the testsJohannes Schindelin2007-11-222-3/+3
| | | | | | | | We no longer have "runstatus", but running "status" is no longer that expensive anyway; it is a builtin. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t7501-commit: Add test for git commit <file> with dirty index.Kristian Høgsberg2007-11-221-0/+10
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: Clean up an unused variable and a debug fprintf().Kristian Høgsberg2007-11-221-5/+3
| | | | | Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Call refresh_cache() when updating the user index for --only commits.Kristian Høgsberg2007-11-221-0/+1
| | | | | | | | | We're guaranteeing the user that the index will be stat-clean after git commit. Thus, we need to call refresh_cache() for the user index too, in the 'git commit <paths>' case. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: Add newline when showing which commit was createdJohannes Schindelin2007-11-221-0/+1
| | | | | | | | The function log_tree_commit() does not break the line, so we have to do it ourselves. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: resurrect behavior for multiple -m optionsJohannes Schindelin2007-11-221-6/+20
| | | | | | | | When more than one -m option is given, the message does not replace the previous, but is appended as a new paragraph. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit --s: add a newline if the last line was not a S-o-bJohannes Schindelin2007-11-222-1/+5
| | | | | | | | | | The rule is this: if the last line already contains the sign off by the current committer, do nothing. If it contains another sign off, just add the sign off of the current committer. If the last line does not contain a sign off, add a new line before adding the sign off. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: fix --signoffJohannes Schindelin2007-11-223-14/+38
| | | | | | | | | | | | | The Signed-off-by: line contained a spurious timestamp. The reason was a call to git_committer_info(1), which automatically added the timestamp. Instead, fmt_ident() was taught to interpret an empty string for the date (as opposed to NULL, which still triggers the default behavior) as "do not bother with the timestamp", and builtin-commit.c uses it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git status: show relative paths when run in a subdirectoryJohannes Schindelin2007-11-225-29/+146
| | | | | | | | | | To show the relative paths, the function formerly called quote_crlf() (now called quote_path()) takes the prefix as an additional argument. While at it, the static buffers were replaced by strbufs. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: Refresh cache after adding files.Kristian Høgsberg2007-11-221-0/+2
| | | | | | | | | | We have promised our users that after running git-status or git-commit the index will be refreshed for a long time since these commands were introduced. Do refresh the index before writing it out to keep the promise. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit: fix reflog message generationJohannes Schindelin2007-11-221-7/+8
| | | | | | | | | Instead of strdup()ing, we can just reuse the buffer in which the commit message is stored, and which is supposed to hold the reflog message anyway. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* launch_editor(): read the file, even when EDITOR=:Johannes Schindelin2007-11-221-12/+5
| | | | | | | | | Earlier we just returned in case EDITOR=: but the message stored in the file was not read back. Fix this, at the same time simplifying the code as suggested by Johannes Sixt. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Port git commit to C.Kristian Høgsberg2007-11-226-9/+621
| | | | | | | | | This makes git commit a builtin and moves git-commit.sh to contrib/examples. This also removes the git-runstatus helper, which was mostly just a git-status.sh implementation detail. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Export launch_editor() and make it accept ':' as a no-op editor.Kristian Høgsberg2007-11-222-1/+5
| | | | | Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add testcase for amending and fixing author in git commit.Kristian Høgsberg2007-11-221-0/+15
| | | | | | | We used to clobber author time, but we shouldn't. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Make test scripts executable.Junio C Hamano2007-11-221-0/+0
|
* Merge branch 'maint'Junio C Hamano2007-11-224-1/+21
|\ | | | | | | | | | | * maint: Make test scripts executable. bundle create: keep symbolic refs' names instead of resolving them
| * Make test scripts executable.Junio C Hamano2007-11-222-0/+0
| |
| * bundle create: keep symbolic refs' names instead of resolving themJohannes Schindelin2007-11-222-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a bundle, symbolic refs used to be resolved to the non-symbolic refs they point to before being written to the list of contained refs. I.e. "git bundle create a1.bundle HEAD master" would show something like 388afe7881b33102fada216dd07806728773c011 refs/heads/master 388afe7881b33102fada216dd07806728773c011 refs/heads/master instead of 388afe7881b33102fada216dd07806728773c011 HEAD 388afe7881b33102fada216dd07806728773c011 refs/heads/master Introduce a special handling so that the symbolic refs are listed with the names passed on the command line. Noticed by Santi Béjar. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase -i: move help to end of todo fileJohannes Schindelin2007-11-222-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [PATCH] rebase -i: move help to end of todo file Many editors start in the first line, so the 9-line help text was an annoyance. So move it to the end. Requested by Junio. While at it, add a hint how to abort the rebase. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-merge-ours: make it a builtin.Thomas Harning2007-11-225-1/+32
| | | | | | | | | | | | | | | | | | Except that this fixes a longstanding corner case bug by tightening the way underlying diff-index command is run, it is functionally equivalent to the scripted version. Signed-off-by: Thomas Harning Jr <harningt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Refactor patch_update_cmdWincent Colaiuta2007-11-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | Split patch_update_cmd into two functions, one to prompt the user for a path to patch and another to do the actual work given that file path. This lays the groundwork for a future commit which will teach git-add--interactive to accept a path parameter and jump directly to the patch subcommand for that path, bypassing the interactive prompt. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Authenticate only once in git-send-emailWincent Colaiuta2007-11-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using git-send-email with SMTP authentication sending a patch series would redundantly authenticate multiple times, once for each patch. In the worst case, this would actually prevent the series from being sent because the server would reply with a "5.5.0 Already Authenticated" status code which would derail the process. This commit teaches git-send-email to authenticate once and only once at the beginning of the series. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge git://git.bogomips.org/git-svnJunio C Hamano2007-11-224-33/+598
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * git://git.bogomips.org/git-svn: git-svn: allow `info' command to work offline git-svn: info --url [path] git-svn info: implement info command git-svn: extract reusable code into utility functions t9106: fix a race condition that caused svn to miss modifications
| * | git-svn: allow `info' command to work offlineEric Wong2007-11-211-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cache the repository root whenever we connect to the repository. This will allow us to notice URL changes if the user changes the URL in .git/config, too. If the repository is no longer accessible, or if `git svn info' is the first and only command run; then '(offline)' will be displayed for "Repository Root:" in the output. Signed-off-by: Eric Wong <normalperson@yhbt.net>
| * | git-svn: info --url [path]David D. Kilzer2007-11-213-3/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return the svn URL for the given path, or return the svn repository URL if no path is given. Added 18 tests to t/t9119-git-svn-info.sh. Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
| * | git-svn info: implement info commandDavid D. Kilzer2007-11-213-0/+413
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement "git-svn info" for files and directories based on the "svn info" command. Note that the -r/--revision argument is not supported yet. Added 18 tests in t/t9119-git-svn-info.sh. [ew: small fix to work without arguments on all working directories] Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
| * | git-svn: extract reusable code into utility functionsDavid D. Kilzer2007-11-211-32/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extacted canonicalize_path() in the main package. Created new Git::SVN::Util package with an md5sum() function. A new package was created so that Digest::MD5 did not have to be loaded in the main package. Replaced code in the SVN::Git::Editor and SVN::Git::Fetcher packages with calls to md5sum(). Extracted the format_svn_date(), parse_git_date() and set_local_timezone() functions within the Git::SVN::Log package. Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
| * | t9106: fix a race condition that caused svn to miss modificationsEric Wong2007-11-211-0/+1
| | | | | | | | | | | | | | | | | | carbonated beverage noticed this test was occasionally failing. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | Fix "quote" misconversion for rewrite diff output.Junio C Hamano2007-11-212-1/+27
|/ / | | | | | | | | | | | | | | | | 663af3422a648e87945e4d8c0cc3e13671f2bbde (Full rework of quote_c_style and write_name_quoted.) mistakenly used puts() when writing out a fixed string when it did not want to add a terminating LF. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge git://repo.or.cz/git-guiJunio C Hamano2007-11-2153-892/+16419
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://repo.or.cz/git-gui: (96 commits) git-gui 0.9.0 git-gui: Bind Meta-T for "Stage To Commit" menu action git-gui: Allow users to set font weights to bold git-gui: Update Japanese strings (part 2) git-gui: Update Japanese strings Updated russian translation of git-gui po2msg: actually output statistics po2msg: ignore untranslated messages po2msg: ignore entries marked with "fuzzy" git-gui: Protect against bad translation strings git-gui: Make sure we get errors from git-update-index More updates and corrections to the russian translation of git-gui Updated Russian translation. git-gui: Update German translation git-gui: Add more terms to glossary. git-gui: Paper bag fix the global config parsing git-gui: Honor a config.mak in git-gui's top level git-gui: Collapse $env(HOME) to ~/ in recent repositories on Windows git-gui: Support cloning Cygwin based work-dirs git-gui: Use proper Windows shortcuts instead of bat files ...
| * | git-gui 0.9.0gitgui-0.9.0Shawn O. Pearce2007-11-211-1/+1
| | | | | | | | | | | | Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | git-gui: Bind Meta-T for "Stage To Commit" menu actionShawn O. Pearce2007-11-081-1/+6
| | | | | | | | | | | | | | | | | | Aaron Digulla suggested we bind Ctrl-T or Cmd-T to "Stage To Commit" menu action so it can be easily accessed from the keyboard. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | git-gui: Allow users to set font weights to boldShawn O. Pearce2007-11-011-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we allowed users to tweak their font weight to be bold by setting it manually in their ~/.gitconfig prior to starting git-gui. This was broken in ae0754ac9a24afa2693246222fc078fe9c133b3a when Simon set the font weight to normal by default, overridding whatever we found from the ~/.gitconfig file. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | git-gui: Update Japanese strings (part 2)Junio C Hamano2007-11-011-1/+1
| | | | | | | | | | | | | | | | | | Resolve an earlier suggestion from Christian. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | git-gui: Update Japanese stringsしらいしななこ2007-11-011-144/+133
| | | | | | | | | | | | | | | | | | | | | This updates the Japanese translation file. Signed-off-by: しらいしななこ <nanako3@bluebottle.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>