]> Kevux Git Server - rit/log
rit
18 years agoReplace instances of export VAR=VAL with VAR=VAL; export VAR
Johannes Schindelin [Wed, 28 Nov 2007 15:56:11 +0000 (15:56 +0000)]
Replace instances of export VAR=VAL with VAR=VAL; export VAR

It might be POSIX, but there are shells that do not like the
expression 'export VAR=VAL'.  To be on the safe side, rewrite them
into 'VAR=VAL' and 'export VAR'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoMerge branch 'maint'
Junio C Hamano [Thu, 29 Nov 2007 01:06:57 +0000 (17:06 -0800)]
Merge branch 'maint'

* maint:
  scripts: do not get confused with HEAD in work tree
  Improve description of git-branch -d and -D in man page.

18 years agoscripts: do not get confused with HEAD in work tree
Junio C Hamano [Thu, 29 Nov 2007 00:15:04 +0000 (16:15 -0800)]
scripts: do not get confused with HEAD in work tree

When you have a file called HEAD in your work tree, many commands that
our scripts feed "HEAD" to would complain about the rev vs path
ambiguity.  A solution is to form command line more carefully by
appending -- to them, which makes it clear that we mean HEAD rev not
HEAD file.

This patch would apply to maint.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agobash completion: add diff options
Johannes Schindelin [Fri, 23 Nov 2007 01:11:35 +0000 (01:11 +0000)]
bash completion: add diff options

I use "git diff" (the porcelain) really often, and am almost as often
annoyed that the completions do not know how to complete something simple
as --cached.  Now they do.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agogit checkout's reflog: even when detaching the HEAD, say from where
Johannes Schindelin [Fri, 23 Nov 2007 00:20:35 +0000 (00:20 +0000)]
git checkout's reflog: even when detaching the HEAD, say from where

When checking out another ref, the reflogs already record from which
branch you switched.  Do that also when switching to a detached HEAD.

While at it, record also when coming _from_ a detached HEAD.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agosha1_file.c: Fix size_t related printf format warnings
Steffen Prohaska [Wed, 21 Nov 2007 20:27:19 +0000 (21:27 +0100)]
sha1_file.c: Fix size_t related printf format warnings

The old way of fixing warnings did not succeed on MinGW.  MinGW
does not support C99 printf format strings for size_t [1].  But
gcc on MinGW issues warnings if C99 printf format is not used.
Hence, the old stragegy to avoid warnings fails.

[1] http://www.mingw.org/MinGWiki/index.php/C99

This commits passes arguments of type size_t through a tiny
helper functions that casts to the type expected by the format
string.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoRevert "t5516: test update of local refs on push"
Jeff King [Wed, 21 Nov 2007 07:19:34 +0000 (02:19 -0500)]
Revert "t5516: test update of local refs on push"

This reverts commit 09fba7a59d38d1cafaf33eadaf1d409c4113b30c.

These tests are superseded by the ones in t5404 (added in
6fa92bf3 and 8736a848), which are more extensive and better
organized.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoImprove description of git-branch -d and -D in man page.
Jan Hudec [Sat, 17 Nov 2007 19:51:44 +0000 (20:51 +0100)]
Improve description of git-branch -d and -D in man page.

Some users expect that deleting a remote-tracking branch would prevent
fetch from creating it again, so be explcit about that it's not the case.
Also be a little more explicit about what fully merged means.

Signed-off-by: Jan Hudec <bulb@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoDocument all help keys in "git add -i" patch mode.
Ralf Wildenhues [Wed, 28 Nov 2007 18:21:42 +0000 (19:21 +0100)]
Document all help keys in "git add -i" patch mode.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agofilter-branch: fix dirty way to provide the helpers to commit filters
Johannes Schindelin [Wed, 28 Nov 2007 15:50:38 +0000 (15:50 +0000)]
filter-branch: fix dirty way to provide the helpers to commit filters

The helper functions 'map' and 'skip_commit' were provided to commit
filters by sourcing filter-branch itself.  This was done with a certain
environment variable set to indicate that only the functions should be
defined, and the script should return then.

This was really hacky, and it did not work all that well, since the
full path to git-filter-branch was not known at all times.

Avoid that by putting the functions into a variable, and eval'ing
that variable.  The commit filter gets these functions by prepending
the variable to the specified commands.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agocvsimport: miscellaneous packed-ref fixes
Jeff King [Wed, 28 Nov 2007 18:56:28 +0000 (13:56 -0500)]
cvsimport: miscellaneous packed-ref fixes

These were found with a grep for '$git_dir'; they all
replace a direct access of "$git_dir/refs/..." with a call
to git-rev-parse or git-update-ref.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agocvsimport: use rev-parse to support packed refs
Jeff King [Wed, 28 Nov 2007 18:56:11 +0000 (13:56 -0500)]
cvsimport: use rev-parse to support packed refs

Previously, if refs were packed, git-cvsimport would assume
that particular refs did not exist. This could lead to, for
example, overwriting previous 'origin' commits that were
packed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoAdd basic cvsimport tests
Jeff King [Wed, 28 Nov 2007 18:55:46 +0000 (13:55 -0500)]
Add basic cvsimport tests

We weren't even testing basic things before, so let's at
least try importing and updating a trivial repository, which
will catch total breakage.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoDo not generate full commit log message if it is not going to be used
Alex Riesen [Wed, 28 Nov 2007 21:13:08 +0000 (22:13 +0100)]
Do not generate full commit log message if it is not going to be used

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>
18 years agogit-stash: do not get fooled with "color.diff = true"
Pascal Obry [Mon, 26 Nov 2007 22:04:28 +0000 (23:04 +0100)]
git-stash: do not get fooled with "color.diff = true"

When colors are set to "true" on the repository, the git log output
will contain control characters to set/reset the colors, even when
the output is to a pipe. This makes list_stash() fail as the
downstream sed does not see what it is expecting.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoRemove git-status from list of scripts as it is builtin
Shawn O. Pearce [Fri, 23 Nov 2007 20:35:08 +0000 (15:35 -0500)]
Remove git-status from list of scripts as it is builtin

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>
18 years agoUpdate German translation. 100% completed.
Christian Stimming [Sat, 24 Nov 2007 09:56:42 +0000 (10:56 +0100)]
Update German translation. 100% completed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
18 years agoUpdate git-gui.pot with latest (few) string additions and changes.
Christian Stimming [Sat, 24 Nov 2007 09:56:32 +0000 (10:56 +0100)]
Update git-gui.pot with latest (few) string additions and changes.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
18 years agoUse is_absolute_path() in diff-lib.c, lockfile.c, setup.c, trace.c
Steffen Prohaska [Sun, 25 Nov 2007 22:29:03 +0000 (23:29 +0100)]
Use is_absolute_path() in diff-lib.c, lockfile.c, setup.c, trace.c

Using the helper function to test for absolute paths makes porting easier.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoFix typo in draft 1.5.4 release notes
Wincent Colaiuta [Mon, 26 Nov 2007 08:34:48 +0000 (09:34 +0100)]
Fix typo in draft 1.5.4 release notes

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoFix off-by-one error when truncating the diff out of the commit message.
Kristian Høgsberg [Mon, 26 Nov 2007 15:16:08 +0000 (10:16 -0500)]
Fix off-by-one error when truncating the diff out of the commit message.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agobuiltin-commit.c: export GIT_INDEX_FILE for launch_editor as well.
Pierre Habouzit [Mon, 26 Nov 2007 08:59:27 +0000 (09:59 +0100)]
builtin-commit.c: export GIT_INDEX_FILE for launch_editor as well.

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>
18 years agogit-tag: test that -s implies an annotated tag
Jeff King [Mon, 26 Nov 2007 04:50:58 +0000 (23:50 -0500)]
git-tag: test that -s implies an annotated tag

This detects a regression introduced while moving git-tag to a C
builtin.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoMerge branch 'maint'
Junio C Hamano [Mon, 26 Nov 2007 03:10:01 +0000 (19:10 -0800)]
Merge branch 'maint'

* maint:
  user-manual: recovering from corruption
  user-manual: clarify language about "modifying" old commits
  user-manual: failed push to public repository
  user-manual: define "branch" and "working tree" at start
  git-checkout: describe detached head correctly

18 years agoMerge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
Junio C Hamano [Mon, 26 Nov 2007 03:04:27 +0000 (19:04 -0800)]
Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint

* 'maint' of git://linux-nfs.org/~bfields/git:
  user-manual: recovering from corruption
  user-manual: clarify language about "modifying" old commits
  user-manual: failed push to public repository
  user-manual: define "branch" and "working tree" at start

18 years agouser-manual: recovering from corruption
J. Bruce Fields [Sun, 4 Mar 2007 03:53:37 +0000 (22:53 -0500)]
user-manual: recovering from corruption

Some instructions on dealing with corruption of the object database.

Most of this text is from an example by Linus, identified by Nicolas
Pitre <nico@cam.org> with a little further editing by me.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
18 years agoPrint the real filename that we failed to open.
André Goddard Rosa [Wed, 21 Nov 2007 20:59:14 +0000 (18:59 -0200)]
Print the real filename that we failed to open.

When we fail to open a temporary file to be renamed to something else,
we reported the final filename, not the temporary file we failed to
open.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agouser-manual: clarify language about "modifying" old commits
J. Bruce Fields [Mon, 26 Nov 2007 00:01:57 +0000 (19:01 -0500)]
user-manual: clarify language about "modifying" old commits

It's important to remember that git doesn't really allowing "editing" or
"modifying" commits, only replacing them by new commits.  Redo some of
the language to make this clearer.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
18 years agorevert/cherry-pick: do not mention the original ref
Junio C Hamano [Sun, 25 Nov 2007 23:15:48 +0000 (15:15 -0800)]
revert/cherry-pick: do not mention the original ref

When you cherry-pick or revert a commit, naming it with an annotated
tag, we added a comment, attempting to repeat what we got from the end
user, to the message.

But this was inconsistent.  When we got "cherry-pick branch", we
recorded the object name (40-letter SHA-1) without saying anything like
"original was 'branch'".  There was no need to.  Also recent rewrite to
use parse-options made it impossible to parrot the original command line
without "unparsing".

This removes the code that implements the misguided "we dereferenced the
tag so record that in the commit message" behaviour.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years ago"git-tag -s" should create a signed annotated tag
Junio C Hamano [Sun, 25 Nov 2007 23:21:42 +0000 (15:21 -0800)]
"git-tag -s" should create a signed annotated tag

The earlier patch 396865859918e9c7bf8ce74aae137c57da134610 (Make
builtin-tag.c use parse_options.) broke "git-tag -s".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agouser-manual: failed push to public repository
J. Bruce Fields [Sun, 25 Nov 2007 22:54:19 +0000 (17:54 -0500)]
user-manual: failed push to public repository

More details on the case of a failed push to a public (non-shared)
repository.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
18 years agoAdd "--patch" option to git-add--interactive
Wincent Colaiuta [Sun, 25 Nov 2007 13:15:42 +0000 (14:15 +0100)]
Add "--patch" option to git-add--interactive

When the "--patch" option is supplied, the patch_update_cmd() function is
called bypassing the main_loop() and exits.

Seeing as builtin-add is the only caller of git-add--interactive we can
impose a strict requirement on the format of the arguments to avoid
possible ambiguity: an "--" argument must be used whenever any pathspecs
are passed, both with the "--patch" option and without it.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
18 years agouser-manual: define "branch" and "working tree" at start
J. Bruce Fields [Sun, 25 Nov 2007 18:53:37 +0000 (13:53 -0500)]
user-manual: define "branch" and "working tree" at start

Some explanation here might help.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
18 years agogit-checkout: describe detached head correctly
Junio C Hamano [Sun, 25 Nov 2007 18:34:27 +0000 (10:34 -0800)]
git-checkout: describe detached head correctly

When you have a file called HEAD in the work tree, the code to report
where the HEAD is at when "git checkout $commit^0" is done triggered
unnecessary ambiguity checking.

Explicitly mark the command line with "--" and make it clear that we are
talking about a revision.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoadd -i: Fix running from a subdirectory
Junio C Hamano [Sun, 25 Nov 2007 18:10:10 +0000 (10:10 -0800)]
add -i: Fix running from a subdirectory

This fixes the pathspec interactive_add() passes to the underlying
git-add--interactive helper.  When the command was run from a
subdirectory, cmd_add() already has gone up to the toplevel of the work
tree, and the helper will be spawned from there.  The pathspec given on
the command line from the user needs to be adjusted for this.

This adds "validate_pathspec()" function in the callchain, but it does
not validate yet.  The function can be changed to barf if there are
unmatching pathspec given by the user, but that is not strictly
necessary.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agobuiltin-add: fix command line building to call interactive
Junio C Hamano [Sun, 25 Nov 2007 18:07:55 +0000 (10:07 -0800)]
builtin-add: fix command line building to call interactive

The earlier 7c0ab4458994aa895855abc4a504cf693ecc0cf1 (Teach builtin-add
to pass multiple paths to git-add--interactive) did not allocate enough,
and had unneeded (void*) pointer arithmetic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoMerge branch 'kh/commit' into wc/add-i
Junio C Hamano [Sun, 25 Nov 2007 16:46:29 +0000 (08:46 -0800)]
Merge branch 'kh/commit' into wc/add-i

This is to use a few functions refactored to use in the built-in
commit series.

* kh/commit: (28 commits)
  Add a few more tests for git-commit
  builtin-commit: Include the diff in the commit message when verbose.
  builtin-commit: fix partial-commit support
  Fix add_files_to_cache() to take pathspec, not user specified list of files
  Export three helper functions from ls-files
  builtin-commit: run commit-msg hook with correct message file
  builtin-commit: do not color status output shown in the message template
  file_exists(): dangling symlinks do exist
  Replace "runstatus" with "status" in the tests
  t7501-commit: Add test for git commit <file> with dirty index.
  builtin-commit: Clean up an unused variable and a debug fprintf().
  Call refresh_cache() when updating the user index for --only commits.
  builtin-commit: Add newline when showing which commit was created
  builtin-commit: resurrect behavior for multiple -m options
  builtin-commit --s: add a newline if the last line was not a S-o-b
  builtin-commit: fix --signoff
  git status: show relative paths when run in a subdirectory
  builtin-commit: Refresh cache after adding files.
  builtin-commit: fix reflog message generation
  launch_editor(): read the file, even when EDITOR=:
  ...

18 years agoUpdate draft release notes for 1.5.4
Junio C Hamano [Sun, 25 Nov 2007 01:42:36 +0000 (17:42 -0800)]
Update draft release notes for 1.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoMerge branch 'maint'
Junio C Hamano [Sun, 25 Nov 2007 03:52:45 +0000 (19:52 -0800)]
Merge branch 'maint'

* maint:
  Fix rev-list when showing objects involving submodules
  test format-patch -s: make sure MIME content type is shown as needed
  format-patch -s: add MIME encoding header if signer's name requires so

18 years agoMerge branch 'rv/maint-index-commit' into maint
Junio C Hamano [Sun, 25 Nov 2007 02:03:29 +0000 (18:03 -0800)]
Merge branch 'rv/maint-index-commit' into maint

* rv/maint-index-commit:
  Make GIT_INDEX_FILE apply to git-commit

18 years agoMerge branch 'lt/maint-rev-list-gitlink' into maint
Junio C Hamano [Sun, 25 Nov 2007 02:03:20 +0000 (18:03 -0800)]
Merge branch 'lt/maint-rev-list-gitlink' into maint

* lt/maint-rev-list-gitlink:
  Fix rev-list when showing objects involving submodules

18 years agoMerge branch 'jc/maint-add-sync-stat' into maint
Junio C Hamano [Sun, 25 Nov 2007 02:03:04 +0000 (18:03 -0800)]
Merge branch 'jc/maint-add-sync-stat' into maint

* jc/maint-add-sync-stat:
  t2200: test more cases of "add -u"
  git-add: make the entry stat-clean after re-adding the same contents
  ce_match_stat, run_diff_files: use symbolic constants for readability

18 years agoMerge branch 'jc/maint-format-patch-encoding' into maint
Junio C Hamano [Sun, 25 Nov 2007 02:02:30 +0000 (18:02 -0800)]
Merge branch 'jc/maint-format-patch-encoding' into maint

* jc/maint-format-patch-encoding:
  test format-patch -s: make sure MIME content type is shown as needed
  format-patch -s: add MIME encoding header if signer's name requires so

18 years agoMerge branch 'bs/maint-t7005' into maint
Junio C Hamano [Sun, 25 Nov 2007 02:01:46 +0000 (18:01 -0800)]
Merge branch 'bs/maint-t7005' into maint

* bs/maint-t7005:
  t7005-editor.sh: Don't invoke real vi when it is in GIT_EXEC_PATH

18 years agoMerge branch 'bs/maint-commit-options' into maint
Junio C Hamano [Sun, 25 Nov 2007 01:54:08 +0000 (17:54 -0800)]
Merge branch 'bs/maint-commit-options' into maint

* bs/maint-commit-options:
  git-commit: Add tests for invalid usage of -a/--interactive with paths
  git-commit.sh: Fix usage checks regarding paths given when they do not make sense

18 years agoDeprecate peek-remote
Junio C Hamano [Sun, 25 Nov 2007 01:41:18 +0000 (17:41 -0800)]
Deprecate peek-remote

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agocore.whitespace: documentation updates.
Junio C Hamano [Sat, 24 Nov 2007 19:57:41 +0000 (11:57 -0800)]
core.whitespace: documentation updates.

This adds description of core.whitespace to the manual page of git-config,
and updates the stale description of whitespace handling in the manual
page of git-apply.

Also demote "strip" to a synonym status for "fix" as the value of --whitespace
option given to git-apply.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agobuiltin-apply: teach whitespace_rules
Junio C Hamano [Sat, 24 Nov 2007 04:14:20 +0000 (20:14 -0800)]
builtin-apply: teach whitespace_rules

We earlier introduced core.whitespace to allow users to tweak the
definition of what the "whitespace errors" are, for the purpose of diff
output highlighting.  This teaches the same to git-apply, so that the
command can both detect (when --whitespace=warn option is given) and fix
(when --whitespace=fix option is given) as configured.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agot4119: correct overeager war-on-whitespace
Junio C Hamano [Sat, 24 Nov 2007 04:13:41 +0000 (20:13 -0800)]
t4119: correct overeager war-on-whitespace

Earlier a6080a0a44d5ead84db3dabbbc80e82df838533d (War on whitespace)
dropped a necessary trailing whitespace from the test vector.

18 years agoMerge branch 'jk/send-pack'
Junio C Hamano [Sun, 25 Nov 2007 00:45:37 +0000 (16:45 -0800)]
Merge branch 'jk/send-pack'

* jk/send-pack: (24 commits)
  send-pack: cluster ref status reporting
  send-pack: fix "everything up-to-date" message
  send-pack: tighten remote error reporting
  make "find_ref_by_name" a public function
  Fix warning about bitfield in struct ref
  send-pack: assign remote errors to each ref
  send-pack: check ref->status before updating tracking refs
  send-pack: track errors for each ref
  git-push: add documentation for the newly added --mirror mode
  Add tests for git push'es mirror mode
  Update the tracking references only if they were succesfully updated on remote
  Add a test checking if send-pack updated local tracking branches correctly
  git-push: plumb in --mirror mode
  Teach send-pack a mirror mode
  send-pack: segfault fix on forced push
  Reteach builtin-ls-remote to understand remotes
  send-pack: require --verbose to show update of tracking refs
  receive-pack: don't mention successful updates
  more terse push output
  Build in ls-remote
  ...

18 years agoMerge branch 'sb/clean'
Junio C Hamano [Sun, 25 Nov 2007 00:31:34 +0000 (16:31 -0800)]
Merge branch 'sb/clean'

* sb/clean:
  Teach git clean to use setup_standard_excludes()
  git-clean: Fix error message if clean.requireForce is not set.
  Make git-clean a builtin

18 years agoMerge branch 'js/mingw-fallouts'
Junio C Hamano [Sun, 25 Nov 2007 00:31:25 +0000 (16:31 -0800)]
Merge branch 'js/mingw-fallouts'

* js/mingw-fallouts:
  fetch-pack: Prepare for a side-band demultiplexer in a thread.
  rehabilitate some t5302 tests on 32-bit off_t machines
  Allow ETC_GITCONFIG to be a relative path.
  Introduce git_etc_gitconfig() that encapsulates access of ETC_GITCONFIG.
  Allow a relative builtin template directory.
  Close files opened by lock_file() before unlinking.
  builtin run_command: do not exit with -1.
  Move #include <sys/select.h> and <sys/ioctl.h> to git-compat-util.h.
  Use is_absolute_path() in sha1_file.c.
  Skip t3902-quoted.sh if the file system does not support funny names.
  t5302-pack-index: Skip tests of 64-bit offsets if necessary.
  t7501-commit.sh: Not all seds understand option -i
  t5300-pack-object.sh: Split the big verify-pack test into smaller parts.

18 years agoMerge branch 'mh/rebase-skip-hard'
Junio C Hamano [Sun, 25 Nov 2007 00:31:08 +0000 (16:31 -0800)]
Merge branch 'mh/rebase-skip-hard'

* mh/rebase-skip-hard:
  Do git reset --hard HEAD when using git rebase --skip

18 years agoMerge branch 'cc/bisect'
Junio C Hamano [Sun, 25 Nov 2007 00:31:02 +0000 (16:31 -0800)]
Merge branch 'cc/bisect'

* cc/bisect:
  Bisect reset: do nothing when not bisecting.
  Bisect: use "$GIT_DIR/BISECT_NAMES" to check if we are bisecting.
  Bisect visualize: use "for-each-ref" to list all good refs.
  git-bisect: modernize branch shuffling hack
  git-bisect: use update-ref to mark good/bad commits
  git-bisect: war on "sed"
  Bisect reset: remove bisect refs that may have been packed.

18 years agobuiltin-apply: rename "whitespace" variables and fix styles
Junio C Hamano [Fri, 23 Nov 2007 10:37:03 +0000 (02:37 -0800)]
builtin-apply: rename "whitespace" variables and fix styles

The variables were somewhat misnamed.

 * "What to do when whitespace errors are detected" is now called
   "ws_error_action" (used to be called "new_whitespace");

 * The constants to denote the possible actions are "nowarn_ws_error",
   "warn_on_ws_error", "die_on_ws_error", and "correct_ws_error".  The
   last one used to be "strip_whitespace", but we correct whitespace
   error in indent (SP followed by HT) and "strip" is not quite an
   accurate name for it.

Other than the renaming of variables and constants, there is no
functional change in this patch.  While we are at it, it also fixes
overly long lines and multi-line comment styles (which of course do
not affect the generated code at all).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoMerge branch 'maint'
Junio C Hamano [Fri, 23 Nov 2007 07:25:42 +0000 (23:25 -0800)]
Merge branch 'maint'

* maint:
  Fix sample pre-commit hook

18 years agoFix sample pre-commit hook
Junio C Hamano [Fri, 23 Nov 2007 07:25:19 +0000 (23:25 -0800)]
Fix sample pre-commit hook

If the worktree happened to have a file called HEAD, "diff-index --cached HEAD"
would complain about the ambiguity between revision and path.  Avoid it by
using an explicit "--" for disambiguation.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoAdd a few more tests for git-commit
Junio C Hamano [Fri, 23 Nov 2007 00:21:49 +0000 (16:21 -0800)]
Add a few more tests for git-commit

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agobuiltin-tag: accept and process multiple -m just like git-commit
Junio C Hamano [Fri, 23 Nov 2007 07:16:51 +0000 (23:16 -0800)]
builtin-tag: accept and process multiple -m just like git-commit

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agogit-branch --contains: doc and test
Junio C Hamano [Mon, 19 Nov 2007 06:22:00 +0000 (22:22 -0800)]
git-branch --contains: doc and test

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agogit-branch --contains=commit
Junio C Hamano [Wed, 7 Nov 2007 22:58:09 +0000 (14:58 -0800)]
git-branch --contains=commit

This teaches git-branch to limit its listing to branches that
are descendants to the named commit.

When you are using many topic branches, you often would want to
see which branch already includes a commit, so that you know
which can and cannot be rewound without disrupting other people.

One thing that sometimes happens to me is:

 * Somebody sends a patch that is a good maint material.  I
   apply it to 'maint':

     $ git checkout maint
     $ git am -3 -s obvious-fix.patch

 * Then somebody else sends another patch that is possibly a
   good maint material, but I'd want to cook it in 'next' to be
   extra sure.  I fork a topic from 'maint' and apply the patch:

     $ git checkout -b xx/maint-fix-foo
     $ git am -3 -s ,xx-maint-fix-foo.patch

 * A minor typo is found in the "obvious-fix.patch".

The above happens without pushing the results out, so I can
freely recover from it by amending 'maint', as long as I do not
forget to rebase the topics that were forked previously.

With this patch, I can do this to find out which topic
branches already contain the faulty commit:

    $ git branch --contains=maint^
      xx/maint-fix-foo

so I can rebase the xx/maint-fix-foo branch before merging it
to 'next'.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoparse-options: Allow to hide options from the default usage.
Pierre Habouzit [Mon, 19 Nov 2007 09:21:44 +0000 (10:21 +0100)]
parse-options: Allow to hide options from the default usage.

This is useful for backward-compatibility aliases, or very advanced command
line switches introduced for internal git usages and have no real use for a
user.

parse-options still shows them if the user asks for --help-all.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agogit-add -i: allow multiple selection in patch subcommand
Junio C Hamano [Thu, 22 Nov 2007 09:47:13 +0000 (01:47 -0800)]
git-add -i: allow multiple selection in patch subcommand

This allows more than one files from the list to be chosen from
the patch subcommand instead of going through the file one by
one.

This also updates the "list-and-choose" UI for usability.  When
the prompt ends with ">>", if you type '*' to choose all
choices, the prompt immediately returns the choice without
requiring an extra empty line to confirm the selection.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoAddendum to "MaintNotes"
Junio C Hamano [Thu, 22 Nov 2007 11:08:39 +0000 (06:08 -0500)]
Addendum to "MaintNotes"

Add "how to maintain git" document. Foreward by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agobuiltin-commit: Include the diff in the commit message when verbose.
Kristian Høgsberg [Thu, 22 Nov 2007 02:54:49 +0000 (21:54 -0500)]
builtin-commit: Include the diff in the commit message when verbose.

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>
18 years agobuiltin-commit: fix partial-commit support
Junio C Hamano [Sun, 18 Nov 2007 09:52:55 +0000 (01:52 -0800)]
builtin-commit: fix partial-commit support

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>
18 years agoFix add_files_to_cache() to take pathspec, not user specified list of files
Junio C Hamano [Sun, 18 Nov 2007 09:12:04 +0000 (01:12 -0800)]
Fix add_files_to_cache() to take pathspec, not user specified list of files

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>
18 years agoExport three helper functions from ls-files
Junio C Hamano [Sun, 18 Nov 2007 09:13:32 +0000 (01:13 -0800)]
Export three helper functions from ls-files

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>
18 years agobuiltin-commit: run commit-msg hook with correct message file
Junio C Hamano [Sun, 18 Nov 2007 20:21:17 +0000 (12:21 -0800)]
builtin-commit: run commit-msg hook with correct message file

It should run with $GIT_DIR/COMMIT_EDITMSG, not just COMMIT_EDITMSG.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agobuiltin-commit: do not color status output shown in the message template
Junio C Hamano [Sun, 18 Nov 2007 20:01:38 +0000 (12:01 -0800)]
builtin-commit: do not color status output shown in the message template

Noticed by Ping Yin on the list.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agofile_exists(): dangling symlinks do exist
Junio C Hamano [Sun, 18 Nov 2007 09:58:16 +0000 (01:58 -0800)]
file_exists(): dangling symlinks do exist

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>
18 years agoReplace "runstatus" with "status" in the tests
Johannes Schindelin [Thu, 15 Nov 2007 06:27:57 +0000 (06:27 +0000)]
Replace "runstatus" with "status" in the tests

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>
18 years agot7501-commit: Add test for git commit <file> with dirty index.
Kristian Høgsberg [Thu, 15 Nov 2007 14:49:58 +0000 (09:49 -0500)]
t7501-commit: Add test for git commit <file> with dirty index.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agobuiltin-commit: Clean up an unused variable and a debug fprintf().
Kristian Høgsberg [Wed, 14 Nov 2007 15:31:53 +0000 (10:31 -0500)]
builtin-commit: Clean up an unused variable and a debug fprintf().

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoCall refresh_cache() when updating the user index for --only commits.
Kristian Høgsberg [Mon, 12 Nov 2007 20:48:22 +0000 (15:48 -0500)]
Call refresh_cache() when updating the user index for --only commits.

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>
18 years agobuiltin-commit: Add newline when showing which commit was created
Johannes Schindelin [Sun, 11 Nov 2007 17:36:52 +0000 (17:36 +0000)]
builtin-commit: Add newline when showing which commit was created

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>
18 years agobuiltin-commit: resurrect behavior for multiple -m options
Johannes Schindelin [Sun, 11 Nov 2007 17:36:39 +0000 (17:36 +0000)]
builtin-commit: resurrect behavior for multiple -m options

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>
18 years agobuiltin-commit --s: add a newline if the last line was not a S-o-b
Johannes Schindelin [Sun, 11 Nov 2007 17:36:27 +0000 (17:36 +0000)]
builtin-commit --s: add a newline if the last line was not a S-o-b

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>
18 years agobuiltin-commit: fix --signoff
Johannes Schindelin [Sun, 11 Nov 2007 17:35:58 +0000 (17:35 +0000)]
builtin-commit: fix --signoff

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>
18 years agogit status: show relative paths when run in a subdirectory
Johannes Schindelin [Sun, 11 Nov 2007 17:35:41 +0000 (17:35 +0000)]
git status: show relative paths when run in a subdirectory

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>
18 years agobuiltin-commit: Refresh cache after adding files.
Kristian Høgsberg [Fri, 9 Nov 2007 16:40:27 +0000 (11:40 -0500)]
builtin-commit: Refresh cache after adding files.

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>
18 years agobuiltin-commit: fix reflog message generation
Johannes Schindelin [Thu, 8 Nov 2007 12:15:26 +0000 (12:15 +0000)]
builtin-commit: fix reflog message generation

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>
18 years agolaunch_editor(): read the file, even when EDITOR=:
Johannes Schindelin [Thu, 8 Nov 2007 14:06:52 +0000 (14:06 +0000)]
launch_editor(): read the file, even when EDITOR=:

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>
18 years agoPort git commit to C.
Kristian Høgsberg [Thu, 8 Nov 2007 16:59:00 +0000 (11:59 -0500)]
Port git commit to C.

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>
18 years agoExport launch_editor() and make it accept ':' as a no-op editor.
Kristian Høgsberg [Fri, 2 Nov 2007 15:33:08 +0000 (11:33 -0400)]
Export launch_editor() and make it accept ':' as a no-op editor.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoAdd testcase for amending and fixing author in git commit.
Kristian Høgsberg [Fri, 2 Nov 2007 15:33:06 +0000 (11:33 -0400)]
Add testcase for amending and fixing author in git commit.

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>
18 years agoMake test scripts executable.
Junio C Hamano [Fri, 23 Nov 2007 00:52:17 +0000 (16:52 -0800)]
Make test scripts executable.

18 years agoMerge branch 'maint'
Junio C Hamano [Fri, 23 Nov 2007 00:51:18 +0000 (16:51 -0800)]
Merge branch 'maint'

* maint:
  Make test scripts executable.
  bundle create: keep symbolic refs' names instead of resolving them

18 years agoMake test scripts executable.
Junio C Hamano [Fri, 23 Nov 2007 00:48:55 +0000 (16:48 -0800)]
Make test scripts executable.

18 years agorebase -i: move help to end of todo file
Johannes Schindelin [Thu, 22 Nov 2007 12:30:10 +0000 (12:30 +0000)]
rebase -i: move help to end of todo file

[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>
18 years agobundle create: keep symbolic refs' names instead of resolving them
Johannes Schindelin [Thu, 22 Nov 2007 12:24:59 +0000 (12:24 +0000)]
bundle create: keep symbolic refs' names instead of resolving them

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>
18 years agogit-merge-ours: make it a builtin.
Thomas Harning [Thu, 22 Nov 2007 20:19:40 +0000 (15:19 -0500)]
git-merge-ours: make it a builtin.

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>
18 years agogit-gui: update it.po and glossary/it.po
Michele Ballabio [Thu, 22 Nov 2007 10:46:21 +0000 (11:46 +0100)]
git-gui: update it.po and glossary/it.po

Updates and fixes:
 * current -> attuale
 * failed -> impossibile/non riuscito
 * corrupt -> danneggiato

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
18 years agogit-gui: fix a typo in lib/commit.tcl
Michele Ballabio [Thu, 22 Nov 2007 15:20:08 +0000 (16:20 +0100)]
git-gui: fix a typo in lib/commit.tcl

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
18 years agoAdd path-limiting to git-add--interactive
Wincent Colaiuta [Thu, 22 Nov 2007 01:36:24 +0000 (02:36 +0100)]
Add path-limiting to git-add--interactive

Implement Junio's suggestion that git-add--interactive should reproduce the
path-limiting semantics of non-interactive git-add.

In otherwords, if "git add -i" (unrestricted) shows paths from a set A,
"git add -i paths..." should show paths from a subset of the set A and that
subset should be defined with the existing ls-files pathspec semantics.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoTeach builtin-add to pass multiple paths to git-add--interactive
Wincent Colaiuta [Thu, 22 Nov 2007 00:02:52 +0000 (01:02 +0100)]
Teach builtin-add to pass multiple paths to git-add--interactive

Instead of just accepting a single file parameter, git-add now accepts
any number of path parameters, fowarding them to git-add--interactive.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 years agoRefactor patch_update_cmd
Wincent Colaiuta [Wed, 21 Nov 2007 12:36:38 +0000 (13:36 +0100)]
Refactor patch_update_cmd

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>
18 years agoAuthenticate only once in git-send-email
Wincent Colaiuta [Wed, 21 Nov 2007 12:35:05 +0000 (13:35 +0100)]
Authenticate only once in git-send-email

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>
18 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Thu, 22 Nov 2007 08:34:49 +0000 (00:34 -0800)]
Merge git://git.bogomips.org/git-svn

* 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

18 years agoFix "quote" misconversion for rewrite diff output.
Junio C Hamano [Thu, 22 Nov 2007 07:06:44 +0000 (23:06 -0800)]
Fix "quote" misconversion for rewrite diff output.

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>