Code

git.git
17 years agoinstaweb: support for Ruby's WEBrick server
Mike Dalessio [Sat, 6 Oct 2007 17:29:49 +0000 (13:29 -0400)]
instaweb: support for Ruby's WEBrick server

running the webrick server with git requires Ruby and Ruby's YAML and
Webrick libraries (both of which come standard with Ruby). nice for
single-user standalone invocations.

the --httpd=webrick option generates a ruby script on the fly to read
httpd.conf options and invoke the web server via library call. this
script is placed in the .git/gitweb directory. it also generates a
shell script in a feeble attempt to invoke ruby in a portable manner,
which assumes that 'ruby' is in the user's $PATH.

Signed-off-by: Mike Dalessio <mike@csa.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoinstaweb: allow for use of auto-generated scripts
Mike Dalessio [Sat, 6 Oct 2007 17:29:48 +0000 (13:29 -0400)]
instaweb: allow for use of auto-generated scripts

this patch allows scripts that reside in $fqgitdir/gitweb to be used
for firing up an instaweb server. this lays the groundwork for
extending instaweb support to non-standard web servers, which may
require a script for proper invocation.

Signed-off-by: Mike Dalessio <mike@csa.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoAdd 'git-p4 commit' as an alias for 'git-p4 submit'
Marius Storm-Olsen [Tue, 9 Oct 2007 14:16:09 +0000 (16:16 +0200)]
Add 'git-p4 commit' as an alias for 'git-p4 submit'

Given that git uses 'commit', git-p4's 'sumbit' was a bit confusing at times;
often making me do 'git submit' and 'git-p4 commit' instead.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Acked-By: Simon Hausmann <simon@lst.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agohg-to-git speedup through selectable repack intervals
Michael Gebetsroither [Sat, 6 Oct 2007 21:16:51 +0000 (23:16 +0200)]
hg-to-git speedup through selectable repack intervals

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-svn: respect Subversion's [auth] section configuration values
Eygene Ryabinkin [Sat, 6 Oct 2007 18:57:19 +0000 (22:57 +0400)]
git-svn: respect Subversion's [auth] section configuration values

Parameters 'store-passwords' and 'store-auth-creds' from Subversion's
configuration (~/.subversion/config) were not respected.  This was
fixed: the default values for these parameters are set to 'yes' to
follow Subversion behaviour.

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogtksourceview2 support for gitview
Frederick Akalin [Fri, 5 Oct 2007 07:20:49 +0000 (00:20 -0700)]
gtksourceview2 support for gitview

Added support for gtksourceview2 module (pygtksourceview 1.90.x) in
gitview.  Also refactored code that creates the source buffer and view.

Signed-off-by: Frederick Akalin <akalin@akalin.cx>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agofix contrib/hooks/post-receive-email hooks.recipients error message
Jeff Muizelaar [Thu, 11 Oct 2007 21:49:21 +0000 (17:49 -0400)]
fix contrib/hooks/post-receive-email hooks.recipients error message

Have the error message for missing recipients actually report the
missing config variable and not a fictional one.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoSupport cvs via git-shell
Johannes Schindelin [Tue, 9 Oct 2007 14:33:25 +0000 (15:33 +0100)]
Support cvs via git-shell

This adds cvs support to the git-shell; You can now give new users
a restricted git-shell and they still can commit via git's cvs
emulator.

Note that either the gecos information must be accurate, or you must
provide a $HOME/.gitconfig with the appropriate user credentials.
Since the git-shell is too restricted to allow the user to do it
(on purpose!), it is up to the administrator to take care of that.

Based on an idea by Jan Wielemaker.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agomakefile: Add a cscope target
Kristof Provost [Sat, 6 Oct 2007 14:24:42 +0000 (16:24 +0200)]
makefile: Add a cscope target

The current makefile supports ctags but not cscope. Some people prefer
cscope (I do), so this patch adds a cscope target.

I've also added cscope* to the .gitignore file. For some reason tags
and TAGS weren't in there either so I've added them too.

Signed-off-by: Kristof Provost <Kristof@provost-engineering.be>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-gc --auto: simplify "repack" command line building
Brandon Casey [Thu, 11 Oct 2007 01:00:27 +0000 (20:00 -0500)]
git-gc --auto: simplify "repack" command line building

Since "-a" is removed from the base repack command line,
we can simplify how we add additional options to this
command line when using --auto.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agogit-gc: by default use safer "-A" option to repack when not --prune'ing
Brandon Casey [Thu, 11 Oct 2007 00:59:19 +0000 (19:59 -0500)]
git-gc: by default use safer "-A" option to repack when not --prune'ing

This makes use of repack's new "-A" option which does not drop packed
unreachable objects. This makes git-gc safe to call at any time,
particularly when a repository is referenced as an alternate by
another repository.

git-gc --prune will use the "-a" option to repack instead of "-A", so
that packed unreachable objects will be removed.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agofix t5403-post-checkout-hook.sh: built-in test in dash does not have "=="
Alex Riesen [Thu, 4 Oct 2007 13:32:53 +0000 (15:32 +0200)]
fix t5403-post-checkout-hook.sh: built-in test in dash does not have "=="

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoUpdate state documentation link for 1.5.3.4
Junio C Hamano [Thu, 4 Oct 2007 08:35:01 +0000 (01:35 -0700)]
Update state documentation link for 1.5.3.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDon't checkout the full tree if avoidable
Steven Walter [Fri, 28 Sep 2007 17:24:19 +0000 (13:24 -0400)]
Don't checkout the full tree if avoidable

In most cases of branching, the tree is copied unmodified from the trunk
to the branch.  When that is done, we can simply start with the parent's
index and apply the changes on the branch as usual.

[ew: rewritten from Steven's original to use SVN::Client instead
     of the command-line svn client.

     Since SVN::Client connects separately, we'll share our
     authentication providers array between our usages of
     SVN::Client and SVN::Ra, too.  Bypassing the high-level
     SVN::Client library can avoid this, but the code will be
     much more complex.  Regardless, any implementation of this
     seems to require restarting a connection to the remote
     server.

     Also of note is that SVN 1.4 and later allows a more
     efficient diff_summary to be done instead of a full diff,
     but since this code is only to support SVN < 1.4.4, we'll
     ignore it for now.]

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agobuiltin-apply: fix conversion error in strbuf series
Junio C Hamano [Thu, 4 Oct 2007 00:42:52 +0000 (17:42 -0700)]
builtin-apply: fix conversion error in strbuf series

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'mv/unknown'
Junio C Hamano [Wed, 3 Oct 2007 11:28:24 +0000 (04:28 -0700)]
Merge branch 'mv/unknown'

* mv/unknown:
  Don't use "<unknown>" for placeholders and suppress printing of empty user formats.

17 years agoMerge branch 'ph/strbuf'
Junio C Hamano [Wed, 3 Oct 2007 10:06:02 +0000 (03:06 -0700)]
Merge branch 'ph/strbuf'

* ph/strbuf: (44 commits)
  Make read_patch_file work on a strbuf.
  strbuf_read_file enhancement, and use it.
  strbuf change: be sure ->buf is never ever NULL.
  double free in builtin-update-index.c
  Clean up stripspace a bit, use strbuf even more.
  Add strbuf_read_file().
  rerere: Fix use of an empty strbuf.buf
  Small cache_tree_write refactor.
  Make builtin-rerere use of strbuf nicer and more efficient.
  Add strbuf_cmp.
  strbuf_setlen(): do not barf on setting length of an empty buffer to 0
  sq_quote_argv and add_to_string rework with strbuf's.
  Full rework of quote_c_style and write_name_quoted.
  Rework unquote_c_style to work on a strbuf.
  strbuf API additions and enhancements.
  nfv?asprintf are broken without va_copy, workaround them.
  Fix the expansion pattern of the pseudo-static path buffer.
  builtin-for-each-ref.c::copy_name() - do not overstep the buffer.
  builtin-apply.c: fix a tiny leak introduced during xmemdupz() conversion.
  Use xmemdupz() in many places.
  ...

17 years agoMerge branch 'lh/merge'
Junio C Hamano [Wed, 3 Oct 2007 10:05:58 +0000 (03:05 -0700)]
Merge branch 'lh/merge'

* lh/merge:
  git-merge: add --ff and --no-ff options
  git-merge: add support for --commit and --no-squash
  git-merge: add support for branch.<name>.mergeoptions
  git-merge: refactor option parsing
  git-merge: fix faulty SQUASH_MSG
  Add test-script for git-merge porcelain

17 years agoMerge branch 'js/rebase-i'
Junio C Hamano [Wed, 3 Oct 2007 10:05:39 +0000 (03:05 -0700)]
Merge branch 'js/rebase-i'

* js/rebase-i:
  rebase -i: work on a detached HEAD

17 years agoMerge branch 'jc/autogc'
Junio C Hamano [Wed, 3 Oct 2007 10:05:32 +0000 (03:05 -0700)]
Merge branch 'jc/autogc'

* jc/autogc:
  git-gc --auto: run "repack -A -d -l" as necessary.
  git-gc --auto: restructure the way "repack" command line is built.
  git-gc --auto: protect ourselves from accumulated cruft
  git-gc --auto: add documentation.
  git-gc --auto: move threshold check to need_to_gc() function.
  repack -A -d: use --keep-unreachable when repacking
  pack-objects --keep-unreachable
  Export matches_pack_name() and fix its return value
  Invoke "git gc --auto" from commit, merge, am and rebase.
  Implement git gc --auto

17 years agoMerge branch 'je/hooks'
Junio C Hamano [Wed, 3 Oct 2007 10:03:40 +0000 (03:03 -0700)]
Merge branch 'je/hooks'

* je/hooks:
  post-checkout hook, tests, and docs

17 years agoMerge branch 'ap/dateformat'
Junio C Hamano [Wed, 3 Oct 2007 10:03:22 +0000 (03:03 -0700)]
Merge branch 'ap/dateformat'

* ap/dateformat:
  Add a test script for for-each-ref, including test of date formatting
  dateformat: parse %(xxdate) %(yydate:format) correctly
  Make for-each-ref's grab_date() support per-atom formatting
  Make for-each-ref allow atom names like "<name>:<something>"
  parse_date_format(): convert a format name to an enum date_mode

17 years agoSync with GIT 1.5.3.4
Junio C Hamano [Wed, 3 Oct 2007 10:03:15 +0000 (03:03 -0700)]
Sync with GIT 1.5.3.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoGIT 1.5.3.4 v1.5.3.4
Junio C Hamano [Wed, 3 Oct 2007 09:33:11 +0000 (02:33 -0700)]
GIT 1.5.3.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd a test script for for-each-ref, including test of date formatting
Andy Parkins [Tue, 2 Oct 2007 11:02:57 +0000 (12:02 +0100)]
Add a test script for for-each-ref, including test of date formatting

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd test case for ls-files --with-tree
Carl Worth [Wed, 3 Oct 2007 07:03:53 +0000 (00:03 -0700)]
Add test case for ls-files --with-tree

This tests basic functionality and also exercises a bug noticed
by Keith Packard, (prune_cache followed by add_index_entry can
trigger an attempt to realloc a pointer into the middle of an
allocated buffer).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMust not modify the_index.cache as it may be passed to realloc at some point.
Keith Packard [Wed, 3 Oct 2007 05:44:15 +0000 (22:44 -0700)]
Must not modify the_index.cache as it may be passed to realloc at some point.

The index cache is not static, growing as new entries are added. If
entries are added after prune_cache is called, cache will no longer
point at the base of the allocation, and realloc will not be happy.

I verified that this was the only place in the current source which
modified any index_state.cache elements aside from the alloc/realloc
calls in read-cache by changing the type of the element to 'struct
cache_entry ** const cache' and recompiling.

A more efficient patch would create a separate 'cache_base' value to
track the allocation and then fix things up when reallocation was
necessary, instead of the brute-force memmove used here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agothe ar tool is called gar on some systems
Robert Schiele [Wed, 3 Oct 2007 01:49:34 +0000 (03:49 +0200)]
the ar tool is called gar on some systems

Some systems that have only installed the GNU toolchain (prefixed with "g")
do not provide "ar" but only "gar".  Make configure find this tool as well.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorename diff_free_filespec_data_large() to diff_free_filespec_blob()
Junio C Hamano [Wed, 3 Oct 2007 04:01:03 +0000 (21:01 -0700)]
rename diff_free_filespec_data_large() to diff_free_filespec_blob()

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agodiffcore-rename: cache file deltas
Jeff King [Tue, 25 Sep 2007 19:29:42 +0000 (15:29 -0400)]
diffcore-rename: cache file deltas

We find rename candidates by computing a fingerprint hash of
each file, and then comparing those fingerprints. There are
inherently O(n^2) comparisons, so it pays in CPU time to
hoist the (rather expensive) computation of the fingerprint
out of that loop (or to cache it once we have computed it once).

Previously, we didn't keep the filespec information around
because then we had the potential to consume a great deal of
memory. However, instead of keeping all of the filespec
data, we can instead just keep the fingerprint.

This patch implements and uses diff_free_filespec_data_large
to accomplish that goal. We also have to change
estimate_similarity not to needlessly repopulate the
filespec data when we already have the hash.

Practical tests showed 4.5x speedup for a 10% memory usage
increase.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMention 'cpio' dependency in INSTALL
Johan Herland [Tue, 2 Oct 2007 23:42:29 +0000 (01:42 +0200)]
Mention 'cpio' dependency in INSTALL

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake git-pull complain and give advice when there is nothing to merge with
Federico Mena Quintero [Tue, 2 Oct 2007 23:36:30 +0000 (18:36 -0500)]
Make git-pull complain and give advice when there is nothing to merge with

Signed-off-by: Federico Mena Quintero <federico@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoNote that git-branch will not automatically checkout the new branch
Federico Mena Quintero [Tue, 2 Oct 2007 23:34:32 +0000 (18:34 -0500)]
Note that git-branch will not automatically checkout the new branch

Signed-off-by: Federico Mena Quintero <federico@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd documentation for --track and --no-track to the git-branch docs.
Federico Mena Quintero [Tue, 2 Oct 2007 23:33:30 +0000 (18:33 -0500)]
Add documentation for --track and --no-track to the git-branch docs.

Signed-off-by: Federico Mena Quintero <federico@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoSay when --track is useful in the git-checkout docs.
Federico Mena Quintero [Tue, 2 Oct 2007 23:32:32 +0000 (18:32 -0500)]
Say when --track is useful in the git-checkout docs.

The documentation used to say what the option does, but it
didn't mention a use case.

Signed-off-by: Federico Mena Quintero <federico@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix typo in config.txt
Johannes Schindelin [Tue, 2 Oct 2007 20:14:30 +0000 (21:14 +0100)]
Fix typo in config.txt

There was an 'l' (ell) instead of a '1' (one) in one of the gitlinks.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofor-each-ref: fix %(numparent) and %(parent)
Junio C Hamano [Tue, 2 Oct 2007 22:09:41 +0000 (15:09 -0700)]
for-each-ref: fix %(numparent) and %(parent)

The string value of %(numparent) was not returned correctly.
Also %(parent) misbehaved for the root commits (returned garbage)
and merge commits (returned first parent, followed by a space).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agodateformat: parse %(xxdate) %(yydate:format) correctly
Junio C Hamano [Tue, 2 Oct 2007 21:31:37 +0000 (14:31 -0700)]
dateformat: parse %(xxdate) %(yydate:format) correctly

Andy Parkins noticed that parsing of the above would not
correctly notice that xxdate does not have any format
specifier.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-commit: initialize TMP_INDEX just to be sure.
Junio C Hamano [Tue, 2 Oct 2007 18:47:58 +0000 (11:47 -0700)]
git-commit: initialize TMP_INDEX just to be sure.

We rely on TMP_INDEX variable to decide if we are doing a partial commit,
as it is only set in the partial commit codepath.  But the variable is
never initialized.  A stray environment variable from outside could
ruin the day.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofixed link in documentation of diff-options
Steffen Prohaska [Tue, 2 Oct 2007 06:14:37 +0000 (08:14 +0200)]
fixed link in documentation of diff-options

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Mon, 1 Oct 2007 09:09:09 +0000 (02:09 -0700)]
Merge branch 'maint'

* maint:
  Whip post 1.5.3.3 maintenance series into shape.
  git stash: document apply's --index switch
  post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used

17 years agoWhip post 1.5.3.3 maintenance series into shape.
Junio C Hamano [Mon, 1 Oct 2007 09:07:47 +0000 (02:07 -0700)]
Whip post 1.5.3.3 maintenance series into shape.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit stash: document apply's --index switch
Miklos Vajna [Sun, 30 Sep 2007 22:30:27 +0000 (00:30 +0200)]
git stash: document apply's --index switch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agopost-receive-hook: Remove the From field from the generated email header so that...
Andy Parkins [Fri, 28 Sep 2007 14:24:26 +0000 (15:24 +0100)]
post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used

Using the name of the committer of the revision at the tip of the
updated ref is not sensible.  That information is available in the email
itself should it be wanted, and by supplying a "From", we were
effectively hiding the person who performed the push - which is useful
information in itself.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUpdate stale documentation link in the k.org site
Junio C Hamano [Mon, 1 Oct 2007 00:32:25 +0000 (17:32 -0700)]
Update stale documentation link in the k.org site

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit.el: Reset the permission flags when changing a file state.
Alexandre Julliard [Sat, 29 Sep 2007 09:59:32 +0000 (11:59 +0200)]
git.el: Reset the permission flags when changing a file state.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit.el: Update a file status in the git buffer upon save.
Alexandre Julliard [Sat, 29 Sep 2007 09:59:07 +0000 (11:59 +0200)]
git.el: Update a file status in the git buffer upon save.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit.el: Do not print a status message on every git command.
Alexandre Julliard [Sat, 29 Sep 2007 09:58:39 +0000 (11:58 +0200)]
git.el: Do not print a status message on every git command.

Instead print a single message around sequences of commands that can
potentially take some time.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit.el: Preserve file marks when doing a full refresh.
Alexandre Julliard [Sat, 29 Sep 2007 09:58:08 +0000 (11:58 +0200)]
git.el: Preserve file marks when doing a full refresh.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix adding a submodule with a remote url
Daniel Barkalow [Sat, 29 Sep 2007 23:39:54 +0000 (19:39 -0400)]
Fix adding a submodule with a remote url

Without this, a non-path URL gets lost before the clone.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-remote: exit with non-zero status after detecting error in "rm".
Jari Aalto [Sun, 30 Sep 2007 06:34:19 +0000 (23:34 -0700)]
git-remote: exit with non-zero status after detecting error in "rm".

Exit with non-zero status when "git remote rm" was told to
remove a non-existing remote.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Sun, 30 Sep 2007 06:32:36 +0000 (23:32 -0700)]
Merge branch 'maint'

* maint:
  git-remote: exit with non-zero status after detecting errors.
  rebase -i: squash should retain the authorship of the _first_ commit
  git-add--interactive: Improve behavior on bogus input
  git-add--interactive: Allow Ctrl-D to exit

17 years agogit-remote: exit with non-zero status after detecting errors.
Jari Aalto [Sun, 30 Sep 2007 06:29:43 +0000 (23:29 -0700)]
git-remote: exit with non-zero status after detecting errors.

Some subcommands of "git-remote" detected and issued error
messages but did not signal that to the calling process with
exit status.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: squash should retain the authorship of the _first_ commit
Johannes Schindelin [Sat, 29 Sep 2007 23:34:23 +0000 (00:34 +0100)]
rebase -i: squash should retain the authorship of the _first_ commit

It was determined on the mailing list, that it makes more sense for a
"squash" to keep the author of the first commit as the author for the
result of the squash.

Make it so.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: support single-letter abbreviations for the actions
Johannes Schindelin [Sat, 29 Sep 2007 02:32:11 +0000 (03:32 +0100)]
rebase -i: support single-letter abbreviations for the actions

When you do many rebases, you can get annoyed by having to type out
the actions "edit" or "squash" in total.

This commit helps that, by allowing you to enter "e" instead of "edit",
"p" instead of "pick", or "s" instead of "squash".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-add--interactive: Improve behavior on bogus input
Jean-Luc Herren [Wed, 26 Sep 2007 14:05:01 +0000 (16:05 +0200)]
git-add--interactive: Improve behavior on bogus input

1) Previously, any menu would cause a perl error when entered '0',
   which is never a valid option.

2) Entering a bogus choice (like 998 or 4-2) surprisingly caused
   the same behavior as if the user had just hit 'enter', which
   means to carry out the selected action on the selected items.
   Entering such bogus input is now a no-op and the sub-menu
   doesn't exit.

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-add--interactive: Allow Ctrl-D to exit
Jean-Luc Herren [Wed, 26 Sep 2007 13:56:19 +0000 (15:56 +0200)]
git-add--interactive: Allow Ctrl-D to exit

Hitting Ctrl-D (EOF) is a common way to exit shell-like tools.
When in a sub-menu it will still behave as if an empty line had
been entered, carrying out the action on the selected items and
returning to the previous menu.

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake read_patch_file work on a strbuf.
Pierre Habouzit [Thu, 27 Sep 2007 11:33:19 +0000 (13:33 +0200)]
Make read_patch_file work on a strbuf.

So that we don't need to use strbuf_detach.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agostrbuf_read_file enhancement, and use it.
Pierre Habouzit [Thu, 27 Sep 2007 13:25:55 +0000 (15:25 +0200)]
strbuf_read_file enhancement, and use it.

* make strbuf_read_file take a size hint (works like strbuf_read)
* use it in a couple of places.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agopost-checkout hook, tests, and docs
Josh England [Wed, 26 Sep 2007 21:31:01 +0000 (15:31 -0600)]
post-checkout hook, tests, and docs

Updated post-checkout hook to take a flag specifying whether the checkout is
a branch checkout or a file checkout (from the index).

Signed-off-by: Josh England <jjengla@sandia.gov>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake for-each-ref's grab_date() support per-atom formatting
Andy Parkins [Fri, 28 Sep 2007 14:17:45 +0000 (15:17 +0100)]
Make for-each-ref's grab_date() support per-atom formatting

grab_date() gets an extra parameter - atomname; this extra parameter is
checked to see if it has a ":<format>" extra component in it, and if so
that "<format>" string is passed to parse_date_format() to produce an
enum date_mode value which is then further passed to show_date().

In short it allows the user of git-for-each-ref to do things like this:

 $ git-for-each-ref --format='%(taggerdate:default)' refs/tags/v1.5.2
 Sun May 20 00:30:42 2007 -0700
 $ git-for-each-ref --format='%(taggerdate:relative)' refs/tags/v1.5.2
 4 months ago
 $ git-for-each-ref --format='%(taggerdate:short)' refs/tags/v1.5.2
 2007-05-20
 $ git-for-each-ref --format='%(taggerdate:local)' refs/tags/v1.5.2
 Sun May 20 08:30:42 2007
 $ git-for-each-ref --format='%(taggerdate:iso8601)' refs/tags/v1.5.2
 2007-05-20 00:30:42 -0700
 $ git-for-each-ref --format='%(taggerdate:rfc2822)' refs/tags/v1.5.2
 Sun, 20 May 2007 00:30:42 -0700

The default, when no ":<format>" is specified is ":default", leaving the
existing behaviour unchanged.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake for-each-ref allow atom names like "<name>:<something>"
Andy Parkins [Fri, 28 Sep 2007 14:17:39 +0000 (15:17 +0100)]
Make for-each-ref allow atom names like "<name>:<something>"

In anticipation of supplying a per-field date format specifier, this
patch makes parse_atom() in builtin-for-each-ref.c allow atoms that have
a valid atom name (as determined by the valid_atom[] table) followed by
a colon, followed by an arbitrary string.

The arbitrary string is where the format for the atom will be specified.

Note, if different formats are specified for the same atom, multiple
entries will be made in the used_atoms table to allow them to be
distinguished by the grab_XXXX() functions.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoparse_date_format(): convert a format name to an enum date_mode
Andy Parkins [Fri, 28 Sep 2007 14:17:31 +0000 (15:17 +0100)]
parse_date_format(): convert a format name to an enum date_mode

Factor out the code to parse --date=<format> parameter to revision
walkers into a separate function, parse_date_format().  This function
is passed a string and converts it to an enum date_format:

 - "relative"         => DATE_RELATIVE
 - "iso8601" or "iso" => DATE_ISO8601
 - "rfc2822"          => DATE_RFC2822
 - "short"            => DATE_SHORT
 - "local"            => DATE_LOCAL
 - "default"          => DATE_NORMAL

In the event that none of these strings is found, the function die()s.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'gr/smtp'
Junio C Hamano [Sat, 29 Sep 2007 23:44:44 +0000 (16:44 -0700)]
Merge branch 'gr/smtp'

* gr/smtp:
  send-email --smtp-server-port: allow overriding the default port

17 years agoMerge branch 'ss/svnimport'
Junio C Hamano [Sat, 29 Sep 2007 23:44:25 +0000 (16:44 -0700)]
Merge branch 'ss/svnimport'

* ss/svnimport:
  Fix pool handling in git-svnimport to avoid memory leaks.

17 years agoMerge branch 'sv/svn'
Junio C Hamano [Sat, 29 Sep 2007 23:43:23 +0000 (16:43 -0700)]
Merge branch 'sv/svn'

* sv/svn:
  git-svn: handle changed svn command-line syntax
  git-svn: fix test for trunk svn (transaction out of date)
  git-svn: fix test for trunk svn (commit message not needed)

17 years agoMerge branch 'ml/submodule'
Junio C Hamano [Sat, 29 Sep 2007 23:43:10 +0000 (16:43 -0700)]
Merge branch 'ml/submodule'

* ml/submodule:
  git-submodule - allow a relative path as the subproject url

17 years agoMerge branch 'jb/remote-rm'
Junio C Hamano [Sat, 29 Sep 2007 23:43:06 +0000 (16:43 -0700)]
Merge branch 'jb/remote-rm'

* jb/remote-rm:
  git-remote rm: add tests and minor fix-ups
  remote: document the 'rm' subcommand
  remote: add 'rm' subcommand

17 years agoMerge branch 'jk/diff-rename'
Junio C Hamano [Sat, 29 Sep 2007 23:42:50 +0000 (16:42 -0700)]
Merge branch 'jk/diff-rename'

* jk/diff-rename:
  diffcore-rename: cache file deltas

17 years agoSync with GIT 1.5.3.3
Junio C Hamano [Sat, 29 Sep 2007 23:31:40 +0000 (16:31 -0700)]
Sync with GIT 1.5.3.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoGIT 1.5.3.3 v1.5.3.3
Junio C Hamano [Sat, 29 Sep 2007 23:07:46 +0000 (16:07 -0700)]
GIT 1.5.3.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix revision log diff setup, avoid unnecessary diff generation
Linus Torvalds [Sat, 29 Sep 2007 16:50:39 +0000 (09:50 -0700)]
Fix revision log diff setup, avoid unnecessary diff generation

We used to incorrectly start calculating diffs whenever any argument but
'-z' was recognized by the diff options parsing. That was bogus, since not
all arguments result in diffs being needed, so we just waste a lot of time
and effort on calculating diffs that don't matter.

This actually also fixes another bug in "git log". Try this:

git log -C

and notice how it prints an extra empty line in between log entries, even
though it never prints the actual diff (because we didn't ask for any diff
format, so the diff machinery never prints anything).

With this patch, that bogus empty line is gone, because "revs->diff" is
never set.  So this isn't just a "wasted time and effort" issue, it's also
a slight semantic fix.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-bundle: fix commandline examples in the manpage
Miklos Vajna [Wed, 26 Sep 2007 23:34:59 +0000 (01:34 +0200)]
git-bundle: fix commandline examples in the manpage

Multiple commands were displayed in one line, making the manpage hard to read.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'mergetool' of git://repo.or.cz/git/mergetool into maint
Junio C Hamano [Sat, 29 Sep 2007 22:39:39 +0000 (15:39 -0700)]
Merge branch 'mergetool' of git://repo.or.cz/git/mergetool into maint

* 'mergetool' of git://repo.or.cz/git/mergetool:
  mergetool: Fix typo in options passed to kdiff3
  mergetool: fix emerge when running in a subdirectory
  Mergetool generating blank files (1.5.3)

17 years agostrbuf change: be sure ->buf is never ever NULL.
Pierre Habouzit [Thu, 27 Sep 2007 10:58:23 +0000 (12:58 +0200)]
strbuf change: be sure ->buf is never ever NULL.

For that purpose, the ->buf is always initialized with a char * buf living
in the strbuf module. It is made a char * so that we can sloppily accept
things that perform: sb->buf[0] = '\0', and because you can't pass "" as an
initializer for ->buf without making gcc unhappy for very good reasons.

strbuf_init/_detach/_grow have been fixed to trust ->alloc and not ->buf
anymore.

as a consequence strbuf_detach is _mandatory_ to detach a buffer, copying
->buf isn't an option anymore, if ->buf is going to escape from the scope,
and eventually be free'd.

API changes:
  * strbuf_setlen now always works, so just make strbuf_reset a convenience
    macro.
  * strbuf_detatch takes a size_t* optional argument (meaning it can be
    NULL) to copy the buffer's len, as it was needed for this refactor to
    make the code more readable, and working like the callers.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agodouble free in builtin-update-index.c
Pierre Habouzit [Thu, 27 Sep 2007 10:51:18 +0000 (12:51 +0200)]
double free in builtin-update-index.c

path_name is either ptr that should not be freed, or a pointer to a strbuf
buffer that is deallocated when exiting the loop. Don't do that !

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agomergetool: Fix typo in options passed to kdiff3
Theodore Ts'o [Sat, 29 Sep 2007 02:26:05 +0000 (22:26 -0400)]
mergetool: Fix typo in options passed to kdiff3

Fix missing double hyphens in "-L1" and "-L2"

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
17 years agomergetool: fix emerge when running in a subdirectory
Theodore Ts'o [Sat, 29 Sep 2007 01:23:22 +0000 (21:23 -0400)]
mergetool: fix emerge when running in a subdirectory

Only pass the basename of the output filename when to emerge, since
emerge interprets non-absolute pathnames relative to the containing
directory of the output buffer.

Thanks to Kelvie Wong for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
17 years agoMergetool generating blank files (1.5.3)
Junio C Hamano [Thu, 27 Sep 2007 21:41:23 +0000 (14:41 -0700)]
Mergetool generating blank files (1.5.3)

When mergetool is run from a subdirectory, "ls-files -u" nicely
limits the output to conflicted files in that directory, but
we need to give the full path to cat-file plumbing to grab the
contents of stages.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
17 years agoquiltimport: Skip non-existent patches
Dan Nicholson [Thu, 27 Sep 2007 20:30:59 +0000 (13:30 -0700)]
quiltimport: Skip non-existent patches

When quiltimport encounters a non-existent patch in the series file,
just skip to the next patch. This matches the behavior of quilt.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoClean up stripspace a bit, use strbuf even more.
Kristian Høgsberg [Tue, 18 Sep 2007 00:06:45 +0000 (20:06 -0400)]
Clean up stripspace a bit, use strbuf even more.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd strbuf_read_file().
Kristian Høgsberg [Tue, 18 Sep 2007 00:06:46 +0000 (20:06 -0400)]
Add strbuf_read_file().

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorerere: Fix use of an empty strbuf.buf
Junio C Hamano [Thu, 27 Sep 2007 06:34:01 +0000 (23:34 -0700)]
rerere: Fix use of an empty strbuf.buf

The code incorrectly assumed that strbuf.buf is always an
allocated piece of memory that has NUL at offset strbuf.len.
That assumption does not hold for a freshly initialized empty
strbuf.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoapply: get rid of --index-info in favor of --build-fake-ancestor
Johannes Schindelin [Mon, 17 Sep 2007 22:34:06 +0000 (23:34 +0100)]
apply: get rid of --index-info in favor of --build-fake-ancestor

git-am used "git apply -z --index-info" to find the original versions
of the files touched by the diff, to be able to do an inexpensive
three-way merge.

This operation makes only sense in a repository, since the index
information in the diff refers to blobs, which have to be present in
the current repository.

Therefore, teach "git apply" a mode to write out the result as an
index file to begin with, obviating the need for scripts to do it
themselves.

The sole user for --index-info is "git am" is converted to
use --build-fake-ancestor in this patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMove make_cache_entry() from merge-recursive.c into read-cache.c
Carlos Rica [Tue, 11 Sep 2007 03:17:28 +0000 (05:17 +0200)]
Move make_cache_entry() from merge-recursive.c into read-cache.c

The function make_cache_entry() is too useful to be hidden away in
merge-recursive.  So move it to libgit.a (exposing it via cache.h).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-email --smtp-server-port: allow overriding the default port
Junio C Hamano [Wed, 26 Sep 2007 00:27:54 +0000 (17:27 -0700)]
send-email --smtp-server-port: allow overriding the default port

You can use --smtp-server-port option to specify a port
different from the default (typically, SMTP servers listen
to smtp port 25 and ssmtp port 465).

Users should be aware that sending auth info over non-ssl
connections may be unsafe or just may not work at all
depending on SMTP server config.

Signed-off-by: Glenn Rempe <glenn@rempe.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoSmall cache_tree_write refactor.
Pierre Habouzit [Tue, 25 Sep 2007 08:22:44 +0000 (10:22 +0200)]
Small cache_tree_write refactor.

This function cannot fail, make it void. Also make write_one act on a
const char* instead of a char*.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake builtin-rerere use of strbuf nicer and more efficient.
Pierre Habouzit [Mon, 24 Sep 2007 09:25:04 +0000 (11:25 +0200)]
Make builtin-rerere use of strbuf nicer and more efficient.

memory is now reused across hunks.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd strbuf_cmp.
Pierre Habouzit [Mon, 24 Sep 2007 09:25:03 +0000 (11:25 +0200)]
Add strbuf_cmp.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agostrbuf_setlen(): do not barf on setting length of an empty buffer to 0
Junio C Hamano [Wed, 26 Sep 2007 09:26:06 +0000 (02:26 -0700)]
strbuf_setlen(): do not barf on setting length of an empty buffer to 0

strbuf_setlen() expect to be able to NUL terminate the buffer,
but a completely empty strbuf could have an empty buffer with 0
allocation; both the assert() and the assignment for NUL
termination would fail.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: work on a detached HEAD
Johannes Schindelin [Tue, 25 Sep 2007 15:43:15 +0000 (16:43 +0100)]
rebase -i: work on a detached HEAD

Earlier, rebase -i refused to rebase a detached HEAD.  Now it no longer
does.

Incidentally, this fixes "git gc --auto" shadowing the true exit status.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'jc/autogc' into js/rebase-i
Junio C Hamano [Wed, 26 Sep 2007 07:42:12 +0000 (00:42 -0700)]
Merge branch 'jc/autogc' into js/rebase-i

* jc/autogc:
  git-gc --auto: run "repack -A -d -l" as necessary.
  git-gc --auto: restructure the way "repack" command line is built.
  git-gc --auto: protect ourselves from accumulated cruft
  git-gc --auto: add documentation.
  git-gc --auto: move threshold check to need_to_gc() function.
  repack -A -d: use --keep-unreachable when repacking
  pack-objects --keep-unreachable
  Export matches_pack_name() and fix its return value
  Invoke "git gc --auto" from commit, merge, am and rebase.
  Implement git gc --auto

Conflicts:

builtin-pack-objects.c

17 years agoDon't use "<unknown>" for placeholders and suppress printing of empty user formats.
Michal Vitecek [Tue, 25 Sep 2007 14:38:46 +0000 (16:38 +0200)]
Don't use "<unknown>" for placeholders and suppress printing of empty user formats.

This changes the interporate() to replace entries with NULL values
by the empty string, and uses it to interpolate missing fields in
custom format output used in git-log and friends.  It is most useful
to avoid <unknown> output from %b format for a commit log message
that lack any body text.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agodiffcore-rename: cache file deltas
Jeff King [Tue, 25 Sep 2007 19:29:42 +0000 (15:29 -0400)]
diffcore-rename: cache file deltas

We find rename candidates by computing a fingerprint hash of
each file, and then comparing those fingerprints. There are
inherently O(n^2) comparisons, so it pays in CPU time to
hoist the (rather expensive) computation of the fingerprint
out of that loop (or to cache it once we have computed it once).

Previously, we didn't keep the filespec information around
because then we had the potential to consume a great deal of
memory. However, instead of keeping all of the filespec
data, we can instead just keep the fingerprint.

This patch implements and uses diff_free_filespec_data_large
to accomplish that goal. We also have to change
estimate_similarity not to needlessly repopulate the
filespec data when we already have the hash.

Practical tests showed 4.5x speedup for a 10% memory usage
increase.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: create .dotest-merge after validating options.
Matt Kraai [Wed, 26 Sep 2007 01:30:13 +0000 (18:30 -0700)]
rebase -i: create .dotest-merge after validating options.

Creating .dotest-merge before validating the options prevents both
--continue and --interactive from working if the options are invalid,
so only create it after validating the options.

[jc: however, just moving the creation of DOTEST breaks output]

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocore-tutorial: correct URL
Randy Dunlap [Wed, 26 Sep 2007 05:02:28 +0000 (22:02 -0700)]
core-tutorial: correct URL

The tinyurl is incorrect -- it attempts to go to groups.osdl.org,
which is gone.  Either use the full URL (in patch) or create a new
tinyurl for this URL.

Is the web page (where I first saw this problem) generated from
this txt file?
http://www.kernel.org/pub/software/scm/git/docs/core-tutorial.html
If not, it needs to be updated also.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix spelling of overridden in documentation
Shawn Bohrer [Wed, 26 Sep 2007 04:12:46 +0000 (23:12 -0500)]
Fix spelling of overridden in documentation

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: avoid exporting GIT_AUTHOR_* variables
Johannes Schindelin [Tue, 25 Sep 2007 15:43:44 +0000 (16:43 +0100)]
rebase -i: avoid exporting GIT_AUTHOR_* variables

It is somewhat unsafe to export the GIT_AUTHOR_* variables, since a later
call to git-commit or git-merge could pick them up inadvertently.

So avoid the export, using a recipe provided by Johannes Sixt.

Incidentally, this fixes authorship of merges with "rebase --preserve -i".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: Fix numbers in progress report
Johannes Schindelin [Tue, 25 Sep 2007 15:43:04 +0000 (16:43 +0100)]
rebase -i: Fix numbers in progress report

Instead of counting all lines in done and todo, we now count the actions
before outputting "$Rebasing ($count/$total)".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: style fixes and minor cleanups
Johannes Schindelin [Tue, 25 Sep 2007 15:42:51 +0000 (16:42 +0100)]
rebase -i: style fixes and minor cleanups

This patch indents ";;" consistently with the rest of git's shell scripts,
and makes sure that ";;" are before each "esac".

It introduces a helper function "has_action", to make it easier to read
the intentions of the code.

Errors from "git rev-parse --verify" are no longer ignored.

Spaces are quoted using single quotes instead of a backslash, for
readability.

A "test $preserve=f" (missing spaces) was fixed; hashes are no longer
written to "$DOTEST"/rewritten/ unnecessarily.

We used to quote the message for a squash, only to have "echo" unquote it.
Now we use "printf" and do not need to quote to start with.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>