git.git
16 years agoTeach/Fix pull/fetch -q/-v options
Tuncer Ayaz [Sat, 15 Nov 2008 00:14:24 +0000 (01:14 +0100)]
Teach/Fix pull/fetch -q/-v options

Implement git-pull --quiet and git-pull --verbose by
adding the options to git-pull and fixing verbosity
handling in git-fetch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Fri, 14 Nov 2008 06:30:17 +0000 (22:30 -0800)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: proper detection of bare repositories
  git-svn: respect i18n.commitencoding config
  git-svn: don't escape tilde ('~') for http(s) URLs

16 years agoMerge branch 'maint'
Junio C Hamano [Fri, 14 Nov 2008 05:58:07 +0000 (21:58 -0800)]
Merge branch 'maint'

* maint:
  date/time: do not get confused by fractional seconds

16 years agodate/time: do not get confused by fractional seconds
Linus Torvalds [Sun, 17 Aug 2008 04:25:40 +0000 (21:25 -0700)]
date/time: do not get confused by fractional seconds

The date/time parsing code was confused if the input time HH:MM:SS is
followed by fractional seconds.  Since we do not record anything finer
grained than seconds, we could just drop fractional part, but there is a
twist.

We have taught people that not just spaces but dot can be used as word
separators when spelling things like:

    $ git log --since 2.days
    $ git show @{12:34:56.7.days.ago}

and we shouldn't mistake "7" in the latter example as a fraction and
discard it.

The rules are:

 - valid days of month/mday are always single or double digits.

 - valid years are either two or four digits

   No, we don't support the year 600 _anyway_, since our encoding is based
   on the UNIX epoch, and the day we worry about the year 10,000 is far
   away and we can raise the limit to five digits when we get closer.

 - Other numbers (eg "600 days ago") can have any number of digits, but
   they cannot start with a zero. Again, the only exception is for
   two-digit numbers, since that is fairly common for dates ("Dec 01" is
   not unheard of)

So that means that any milli- or micro-second would be thrown out just
because the number of digits shows that it cannot be an interesting date.

A milli- or micro-second can obviously be a perfectly fine number
according to the rules above, as long as it doesn't start with a '0'. So
if we have

12:34:56.123

then that '123' gets parsed as a number, and we remember it. But because
it's bigger than 31, we'll never use it as such _unless_ there is
something after it to trigger that use.

So you can say "12:34:56.123.days.ago", and because of the "days", that
123 will actually be meaninful now.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Thu, 13 Nov 2008 16:28:51 +0000 (08:28 -0800)]
Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix linehtag undefined error with file highlighting
  gitk: Fix commit encoding support
  gitk: Fix transient windows on Win32 and MacOS
  gitk: Add accelerators to frequently used menu commands
  gitk: Implement a user-friendly Edit View dialog
  gitk: Improve cherry-pick error handling
  gitk: Make cherry-pick call git-citool on conflicts
  gitk: Make gitk dialog windows transient
  gitk: Add Return and Escape bindings to dialogs
  gitk: Cope with unmerged files in local changes
  gitk: Make "show origin of this line" work on fake commits
  gitk: Unify handling of merge diffs with normal 2-way diffs
  gitk: Make the background color of marked lines configurable
  gitk: Add a menu item to show where a given line comes from
  gitk: Fix some off-by-one errors in computing which line to blame
  gitk: Allow starting gui blame for a specific line
  gitk: Fix file list context menu for merge commits
  gitk: Allow forcing branch creation if it already exists

16 years agogitk: Fix linehtag undefined error with file highlighting
Paul Mackerras [Thu, 13 Nov 2008 11:39:00 +0000 (22:39 +1100)]
gitk: Fix linehtag undefined error with file highlighting

Occasionally gitk will throw a Tcl error complaining that linehtag(n)
is undefined when.  It happens when the commit list is still growing
(e.g. when updating the commit list) and gitk is set to highlight
commits that affect certain file(s).  What happens is that the changes
to the commit list set need_redisplay to indicate that the display
needs to be redrawn.  That causes the next call to drawcommits to call
clear_display, which unsets iddrawn and thus ensures that readfhighlight
won't call bolden on any rows that have moved.  However, it is possible
for readfhighlight to be called after the commit list has changed but
before drawcommits has run, meaning that readfhighlight will potentially
think that rows have been drawn when they haven't, because of the
change in the id -> row mapping (and the fact that iddrawn is indexed
by id but line[hnd]tag are indexed by row number).

This fixes it (and also optimizes things a little) by making bolden
and bolden_name check need_redisplay before doing anything.  If
need_redisplay is set, then there is no point doing anything because
the whole display is about to get cleared and redrawn, and it avoids
looking up line[hn]tag using stale row numbers.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Fix commit encoding support
Alexander Gavrilov [Sun, 9 Nov 2008 15:06:07 +0000 (18:06 +0300)]
gitk: Fix commit encoding support

This commit fixes two problems with commit encodings:

1) git-log actually uses i18n.logoutputencoding to generate
   its output, and falls back to i18n.commitencoding only
   when that option is not set.  Thus, gitk should use its
   value to read the results, if available.

2) The readcommit function did not process encodings at all.
   This led to randomly appearing misconverted commits if
   the commit encoding differed from the current locale.

Now commit messages should be displayed correctly, except
when logoutputencoding is set to an encoding that cannot
represent charecters in the message.  For example, it is
impossible to convert Japanese characters from Shift-JIS
to CP-1251 (although the reverse conversion works).

The reason for using git log to read the commit and then getting
Tcl to convert its output is that is essentially what happens in
the normal path through getcommitlines, hence there is less chance
for unintended differences in how commits are processed in
getcommitlines and do_readcommit.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Fix transient windows on Win32 and MacOS
Alexander Gavrilov [Tue, 11 Nov 2008 20:55:42 +0000 (23:55 +0300)]
gitk: Fix transient windows on Win32 and MacOS

Transient windows cause problems on these platforms:

- On Win32 the windows appear in the top left corner
  of the screen. In order to fix it, this patch causes
  them to be explicitly centered on their parents by
  an idle handler.

- On MacOS with Tk 8.4 they appear without a title bar.
  Since it is clearly unacceptable, this patch disables
  transient on that platform.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Add accelerators to frequently used menu commands
Alexander Gavrilov [Sun, 9 Nov 2008 10:00:45 +0000 (13:00 +0300)]
gitk: Add accelerators to frequently used menu commands

This commit documents keyboard accelerators used for menu
commands in the menu, as it is usually done, and adds some
more, e.g. F4 to invoke Edit View (or New View if the current
view is the un-editable "All files" view).

The changes include a workaround for handling Shift-F4 on
systems where XKB binds special XF86_Switch_VT_* symbols
to Ctrl-Alt-F* combinations.  Tk often receives these codes
when Shift-F* is pressed, so it is necessary to bind the
relevant actions to them as well.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoUpdate draft release notes to 1.6.1
Junio C Hamano [Thu, 13 Nov 2008 06:47:15 +0000 (22:47 -0800)]
Update draft release notes to 1.6.1

A large number of topics are merged to prepare for -rc0 now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'jn/gitweb-customlinks'
Junio C Hamano [Thu, 13 Nov 2008 06:27:53 +0000 (22:27 -0800)]
Merge branch 'jn/gitweb-customlinks'

* jn/gitweb-customlinks:
  gitweb: Better processing format string in custom links in navbar

16 years agoMerge branch 'gb/gitweb-snapshot-pathinfo'
Junio C Hamano [Thu, 13 Nov 2008 06:27:49 +0000 (22:27 -0800)]
Merge branch 'gb/gitweb-snapshot-pathinfo'

* gb/gitweb-snapshot-pathinfo:
  gitweb: embed snapshot format parameter in PATH_INFO
  gitweb: retrieve snapshot format from PATH_INFO
  gitweb: make the supported snapshot formats array global

16 years agoMerge branch 'ds/uintmax-config' (early part)
Junio C Hamano [Thu, 13 Nov 2008 06:27:33 +0000 (22:27 -0800)]
Merge branch 'ds/uintmax-config' (early part)

* 'ds/uintmax-config' (early part):
  Add autoconf tests for pthreads
  Make Pthread link flags configurable
  Add Makefile check for FreeBSD 4.9-SECURITY
  Build: add NO_UINTMAX_T to support ancient systems

Conflicts:
Makefile

16 years agoMerge branch 'jk/maint-commit-v-strip'
Junio C Hamano [Thu, 13 Nov 2008 06:26:56 +0000 (22:26 -0800)]
Merge branch 'jk/maint-commit-v-strip'

* jk/maint-commit-v-strip:
  commit: Fix stripping of patch in verbose mode.

16 years agoMerge branch 'np/pack-safer'
Junio C Hamano [Thu, 13 Nov 2008 06:26:35 +0000 (22:26 -0800)]
Merge branch 'np/pack-safer'

* np/pack-safer:
  t5303: fix printf format string for portability
  t5303: work around printf breakage in dash
  pack-objects: don't leak pack window reference when splitting packs
  extend test coverage for latest pack corruption resilience improvements
  pack-objects: allow "fixing" a corrupted pack without a full repack
  make find_pack_revindex() aware of the nasty world
  make check_object() resilient to pack corruptions
  make packed_object_info() resilient to pack corruptions
  make unpack_object_header() non fatal
  better validation on delta base object offsets
  close another possibility for propagating pack corruption

16 years agoMerge branch 'mk/maint-cg-push'
Junio C Hamano [Thu, 13 Nov 2008 06:26:24 +0000 (22:26 -0800)]
Merge branch 'mk/maint-cg-push'

* mk/maint-cg-push:
  git push: Interpret $GIT_DIR/branches in a Cogito compatible way

Conflicts:
t/t5516-fetch-push.sh

16 years agoMerge branch 'bc/maint-keep-pack'
Junio C Hamano [Thu, 13 Nov 2008 06:00:43 +0000 (22:00 -0800)]
Merge branch 'bc/maint-keep-pack'

* bc/maint-keep-pack:
  t7700: test that 'repack -a' packs alternate packed objects
  pack-objects: extend --local to mean ignore non-local loose objects too
  sha1_file.c: split has_loose_object() into local and non-local counterparts
  t7700: demonstrate mishandling of loose objects in an alternate ODB
  builtin-gc.c: use new pack_keep bitfield to detect .keep file existence
  repack: do not fall back to incremental repacking with [-a|-A]
  repack: don't repack local objects in packs with .keep file
  pack-objects: new option --honor-pack-keep
  packed_git: convert pack_local flag into a bitfield and add pack_keep
  t7700: demonstrate mishandling of objects in packs with a .keep file

16 years agoMerge branch 'mv/remote-rename'
Junio C Hamano [Thu, 13 Nov 2008 06:00:25 +0000 (22:00 -0800)]
Merge branch 'mv/remote-rename'

* mv/remote-rename:
  git-remote: document the migration feature of the rename subcommand
  git-remote rename: migrate from remotes/ and branches/
  remote: add a new 'origin' variable to the struct
  Implement git remote rename

16 years agoMerge branch 'jk/deny-push-to-current'
Junio C Hamano [Thu, 13 Nov 2008 05:56:14 +0000 (21:56 -0800)]
Merge branch 'jk/deny-push-to-current'

* jk/deny-push-to-current:
  receive-pack: detect push to current branch of non-bare repo
  t5516: refactor oddball tests

16 years agoMerge branch 'dl/xdiff'
Junio C Hamano [Thu, 13 Nov 2008 05:51:30 +0000 (21:51 -0800)]
Merge branch 'dl/xdiff'

* dl/xdiff:
  xdiff: give up scanning similar lines early

16 years agoMerge branch 'lt/decorate'
Junio C Hamano [Thu, 13 Nov 2008 05:51:19 +0000 (21:51 -0800)]
Merge branch 'lt/decorate'

* lt/decorate:
  rev-list documentation: clarify the two parts of history simplification
  Document "git log --simplify-by-decoration"
  Document "git log --source"
  revision traversal: '--simplify-by-decoration'
  Make '--decorate' set an explicit 'show_decorations' flag
  revision: make tree comparison functions take commits rather than trees
  Add a 'source' decorator for commits

Conflicts:
Documentation/rev-list-options.txt

16 years agoMerge branch 'jk/diff-convfilter'
Junio C Hamano [Thu, 13 Nov 2008 05:50:58 +0000 (21:50 -0800)]
Merge branch 'jk/diff-convfilter'

* jk/diff-convfilter:
  enable textconv for diff in verbose status/commit
  wt-status: load diff ui config
  only textconv regular files
  userdiff: require explicitly allowing textconv
  refactor userdiff textconv code

Conflicts:
t/t4030-diff-textconv.sh

16 years agoMerge branch 'jk/diff-convfilter-test-fix'
Junio C Hamano [Thu, 13 Nov 2008 05:50:41 +0000 (21:50 -0800)]
Merge branch 'jk/diff-convfilter-test-fix'

* jk/diff-convfilter-test-fix:
  Avoid using non-portable `echo -n` in tests.
  add userdiff textconv tests
  document the diff driver textconv feature
  diff: add missing static declaration

Conflicts:
Documentation/gitattributes.txt

16 years agoMerge branch 'st/tag'
Junio C Hamano [Thu, 13 Nov 2008 05:49:25 +0000 (21:49 -0800)]
Merge branch 'st/tag'

* st/tag:
  tag: Add more tests about mixing incompatible modes and options
  tag: Check that options are only allowed in the appropriate mode

16 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Thu, 13 Nov 2008 05:12:41 +0000 (21:12 -0800)]
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
  git-gui: Request blame metadata in utf-8.
  git-gui: Add the Show SSH Key item to the clone dialog.
  git-gui: Fix focus transition in the blame viewer.

16 years agot7700: test that 'repack -a' packs alternate packed objects
Brandon Casey [Thu, 13 Nov 2008 00:50:26 +0000 (18:50 -0600)]
t7700: test that 'repack -a' packs alternate packed objects

Previously, when 'repack -a' was called and there were no packs in the local
repository without a .keep file, the repack would fall back to calling
pack-objects with '--unpacked --incremental'. This resulted in the created
pack file, if any, to be missing the packed objects in the alternate object
store. Test that this specific case has been fixed.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.html: Update the links to stale versions
Junio C Hamano [Wed, 12 Nov 2008 23:04:54 +0000 (15:04 -0800)]
git.html: Update the links to stale versions

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 12 Nov 2008 23:03:57 +0000 (15:03 -0800)]
Merge branch 'maint'

* maint:
  Start 1.6.0.5 cycle
  Fix pack.packSizeLimit and --max-pack-size handling
  checkout: Fix "initial checkout" detection
  Remove the period after the git-check-attr summary

Conflicts:
RelNotes

16 years agoStart 1.6.0.5 cycle
Junio C Hamano [Wed, 12 Nov 2008 23:03:03 +0000 (15:03 -0800)]
Start 1.6.0.5 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix pack.packSizeLimit and --max-pack-size handling
Nicolas Pitre [Wed, 12 Nov 2008 18:23:58 +0000 (13:23 -0500)]
Fix pack.packSizeLimit and --max-pack-size handling

If the limit was sufficiently low, having a single object written
could bust the limit (by design), but caused the remaining allowed
size to go negative for subsequent objects, which for an unsigned
variable is a rather huge limit.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorev-list documentation: clarify the two parts of history simplification
Santi Béjar [Wed, 12 Nov 2008 10:51:28 +0000 (11:51 +0100)]
rev-list documentation: clarify the two parts of history simplification

One set of options and parameters determine what commits are involved in
the simplification process, and another set of options determine how the
simplification is done.  Clarify their distinction at the beginning.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocument "git log --simplify-by-decoration"
Nanako Shiraishi [Mon, 10 Nov 2008 09:58:17 +0000 (18:58 +0900)]
Document "git log --simplify-by-decoration"

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocheckout: Fix "initial checkout" detection
Junio C Hamano [Wed, 12 Nov 2008 19:52:35 +0000 (11:52 -0800)]
checkout: Fix "initial checkout" detection

Earlier commit 5521883 (checkout: do not lose staged removal, 2008-09-07)
tightened the rule to prevent switching branches from losing local
changes, so that staged removal of paths can be protected, while
attempting to keep a loophole to still allow a special case of switching
out of an un-checked-out state.

However, the loophole was made a bit too tight, and did not allow
switching from one branch (in an un-checked-out state) to check out
another branch.

The change to builtin-checkout.c in this commit loosens it to allow this,
by not insisting the original commit and the new commit to be the same.

It also introduces a new function, is_index_unborn (and an associated
macro, is_cache_unborn), to check if the repository is truly in an
un-checked-out state more reliably, by making sure that $GIT_INDEX_FILE
did not exist when populating the in-core index structure.  A few places
the earlier commit 5521883 added the check for the initial checkout
condition are updated to use this function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocommit: Fix stripping of patch in verbose mode.
Jeff King [Wed, 12 Nov 2008 08:25:52 +0000 (03:25 -0500)]
commit: Fix stripping of patch in verbose mode.

When the "-v" option is given, we put diff of what is to be committed into
the commit template, and then strip it back out again after the user has
edited it.

We used to look for the diff by searching for the "diff --git a/"
header. With diff.mnemonicprefix set in the configuration, however, this
pattern does not match.  The pattern is loosened to cover this case.

Also, if the user puts their own diff in the message (e.g., as a sample
output), then we will accidentally trigger the pattern, removing part of
their output.

We can avoid doing this stripping altogether if the user didn't use "-v"
in the first place, so we know that any match we find will be a false
positive.

[jc: this fix was split out of a series originally meant for master.]

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRemove the period after the git-check-attr summary
Matt Kraai [Fri, 7 Nov 2008 12:26:55 +0000 (04:26 -0800)]
Remove the period after the git-check-attr summary

The period at the end of the git-check-attr summary causes there to be
two periods after the summary in the git(1) manual page.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopack-objects: extend --local to mean ignore non-local loose objects too
Brandon Casey [Mon, 10 Nov 2008 05:59:58 +0000 (23:59 -0600)]
pack-objects: extend --local to mean ignore non-local loose objects too

With this patch, --local means pack only local objects that are not already
packed.

Additionally, this fixes t7700 testing whether loose objects in an alternate
object database are repacked.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosha1_file.c: split has_loose_object() into local and non-local counterparts
Brandon Casey [Mon, 10 Nov 2008 05:59:57 +0000 (23:59 -0600)]
sha1_file.c: split has_loose_object() into local and non-local counterparts

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot7700: demonstrate mishandling of loose objects in an alternate ODB
Brandon Casey [Mon, 10 Nov 2008 05:59:56 +0000 (23:59 -0600)]
t7700: demonstrate mishandling of loose objects in an alternate ODB

Loose objects residing in an alternate object database should not be packed
when the -l option to repack is used.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-gc.c: use new pack_keep bitfield to detect .keep file existence
Brandon Casey [Wed, 12 Nov 2008 17:59:07 +0000 (11:59 -0600)]
builtin-gc.c: use new pack_keep bitfield to detect .keep file existence

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorepack: do not fall back to incremental repacking with [-a|-A]
Brandon Casey [Wed, 12 Nov 2008 17:59:06 +0000 (11:59 -0600)]
repack: do not fall back to incremental repacking with [-a|-A]

When repack is called with either the -a or -A option, the user has
requested to repack all objects including those referenced by the
alternates mechanism. Currently, if there are no local packs without
.keep files, then repack will call pack-objects with the
'--unpacked --incremental' options which causes it to exclude alternate
packed objects. So, remove this fallback.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorepack: don't repack local objects in packs with .keep file
Brandon Casey [Wed, 12 Nov 2008 17:59:05 +0000 (11:59 -0600)]
repack: don't repack local objects in packs with .keep file

If the user created a .keep file for a local pack, then it can be inferred
that the user does not want those objects repacked.

This fixes the repack bug tested by t7700.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopack-objects: new option --honor-pack-keep
Brandon Casey [Wed, 12 Nov 2008 17:59:04 +0000 (11:59 -0600)]
pack-objects: new option --honor-pack-keep

This adds a new option to pack-objects which will cause it to ignore an
object which appears in a local pack which has a .keep file, even if it
was specified for packing.

This option will be used by the porcelain repack.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopacked_git: convert pack_local flag into a bitfield and add pack_keep
Brandon Casey [Wed, 12 Nov 2008 17:59:03 +0000 (11:59 -0600)]
packed_git: convert pack_local flag into a bitfield and add pack_keep

pack_keep will be set when a pack file has an associated .keep file.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot7700: demonstrate mishandling of objects in packs with a .keep file
Brandon Casey [Wed, 12 Nov 2008 17:59:02 +0000 (11:59 -0600)]
t7700: demonstrate mishandling of objects in packs with a .keep file

Objects residing in pack files that have an associated .keep file are not
supposed to be repacked into new pack files, but they are.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-remote: document the migration feature of the rename subcommand
Miklos Vajna [Mon, 10 Nov 2008 20:43:03 +0000 (21:43 +0100)]
git-remote: document the migration feature of the rename subcommand

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-remote rename: migrate from remotes/ and branches/
Miklos Vajna [Mon, 10 Nov 2008 20:43:01 +0000 (21:43 +0100)]
git-remote rename: migrate from remotes/ and branches/

Remote definition that came from $GIT_DIR/remotes/nick and
$GIT_DIR/branches/nick are migrated to [remotes "nick"] section in the
configuration file.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit push: Interpret $GIT_DIR/branches in a Cogito compatible way
Martin Koegler [Mon, 10 Nov 2008 21:47:11 +0000 (22:47 +0100)]
git push: Interpret $GIT_DIR/branches in a Cogito compatible way

Current git versions ignore everything after # (called <head> in the
following) when pushing. Older versions (before cf818348f1ab57),
interpret #<head> as part of the URL, which make git bail out.

As branches origin from Cogito, it is the best to correct this by using
the behaviour of cg-push, that is to push HEAD to remote refs/heads/<head>.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-diff: Add --staged as a synonym for --cached.
David Symonds [Wed, 29 Oct 2008 16:15:36 +0000 (09:15 -0700)]
git-diff: Add --staged as a synonym for --cached.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-p4: Cache git config for performance
John Chapman [Sat, 8 Nov 2008 03:22:49 +0000 (14:22 +1100)]
git-p4: Cache git config for performance

This makes git-p4 noticibly faster on Windows.

Signed-off-by: John Chapman <thestar@fussycoder.id.au>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-p4: Support purged files and optimize memory usage
John Chapman [Sat, 8 Nov 2008 03:22:48 +0000 (14:22 +1100)]
git-p4: Support purged files and optimize memory usage

Purged files are handled as if they are merely deleted, which is not
entirely optimal, but I don't know of any other way to handle them.
File data is deleted from memory as early as they can, and they are more
efficiently handled, at (significant) cost to CPU usage.

Still need to handle p4 branches with spaces in their names.
Still need to make git-p4 clone more reliable.
 - Perhaps with a --continue option. (Sometimes the p4 server kills
 the connection)

Signed-off-by: John Chapman <thestar@fussycoder.id.au>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix non-literal format in printf-style calls
Daniel Lowe [Mon, 10 Nov 2008 21:07:52 +0000 (16:07 -0500)]
Fix non-literal format in printf-style calls

These were found using gcc 4.3.2-1ubuntu11 with the warning:

    warning: format not a string literal and no format arguments

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Tue, 11 Nov 2008 22:46:31 +0000 (14:46 -0800)]
Merge branch 'maint'

* maint:
  Fix non-literal format in printf-style calls
  git-submodule: Avoid printing a spurious message.
  git ls-remote: make usage string match manpage
  Makefile: help people who run 'make check' by mistake

16 years agoFix non-literal format in printf-style calls
Daniel Lowe [Mon, 10 Nov 2008 21:07:52 +0000 (16:07 -0500)]
Fix non-literal format in printf-style calls

These were found using gcc 4.3.2-1ubuntu11 with the warning:

    warning: format not a string literal and no format arguments

Incorporated suggestions from Brandon Casey <casey@nrlssc.navy.mil>.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoremote: add a new 'origin' variable to the struct
Miklos Vajna [Mon, 10 Nov 2008 20:43:00 +0000 (21:43 +0100)]
remote: add a new 'origin' variable to the struct

This allows one to track where was the remote's original source, so that
it's possible to decide if it makes sense to migrate it to the config
format or not.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-submodule: Avoid printing a spurious message.
Alexandre Julliard [Tue, 11 Nov 2008 21:09:16 +0000 (22:09 +0100)]
git-submodule: Avoid printing a spurious message.

Fix 'git submodule update' to avoid printing a spurious "Maybe you want
to use 'update --init'?" once for every uninitialized submodule it
encounters.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit ls-remote: make usage string match manpage
Stefan Naewe [Tue, 11 Nov 2008 15:52:31 +0000 (16:52 +0100)]
git ls-remote: make usage string match manpage

The usage string of 'git ls-remote' is pretty terse. The manpage
however gives the correct 'synopsis'.

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMakefile: help people who run 'make check' by mistake
Junio C Hamano [Tue, 11 Nov 2008 21:12:17 +0000 (13:12 -0800)]
Makefile: help people who run 'make check' by mistake

The target to run self test is 'make test', but there are people who try
'make check' and worse yet do not have sparse installed.

Suggest 'make test' target when they do not have 'sparse'.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocument "git log --source"
Nanako Shiraishi [Mon, 10 Nov 2008 09:58:15 +0000 (18:58 +0900)]
Document "git log --source"

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Request blame metadata in utf-8.
Alexander Gavrilov [Sun, 9 Nov 2008 15:53:09 +0000 (18:53 +0300)]
git-gui: Request blame metadata in utf-8.

The blame builtin now supports automatic conversion of
metadata encoding. By default it is converted to the
character set specified by i18n.logoutputencoding.

Since gui blame expects the data in utf-8, it is
necessary to specify the desired encoding directly.
An old version of the blame command will simply
ignore the option.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add the Show SSH Key item to the clone dialog.
Alexander Gavrilov [Sun, 9 Nov 2008 15:51:16 +0000 (18:51 +0300)]
git-gui: Add the Show SSH Key item to the clone dialog.

The user might need to see the key before cloning a repository.
This patch makes the relevant menu item available in the Select
Repository/Clone dialog.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix focus transition in the blame viewer.
Alexander Gavrilov [Sun, 9 Nov 2008 15:36:50 +0000 (18:36 +0300)]
git-gui: Fix focus transition in the blame viewer.

Now that the blame viewer has a search panel, it should be
taken into account by the focus transition code. Otherwise
showing a commit tip (by accidentally moving the mouse to
the text frame) causes the focus to transfer away from the
search field.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agot5303: fix printf format string for portability
Junio C Hamano [Sun, 9 Nov 2008 21:11:06 +0000 (13:11 -0800)]
t5303: fix printf format string for portability

printf "\x01" is bad; write printf "\001" for portability.

Testing with dash is a good way to find this kind of POSIX.1 violation
breakages.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot5303: work around printf breakage in dash
Junio C Hamano [Sun, 9 Nov 2008 21:08:38 +0000 (13:08 -0800)]
t5303: work around printf breakage in dash

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd autoconf tests for pthreads
David M. Syzdek [Mon, 3 Nov 2008 18:14:28 +0000 (09:14 -0900)]
Add autoconf tests for pthreads

Set the value of PTHREAD_LIBS to the correct flags for linking pthreads on
the current environment.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Sun, 9 Nov 2008 18:56:26 +0000 (10:56 -0800)]
Merge branch 'maint'

* maint:
  Documentation: bisect: change a few instances of "git-cmd" to "git cmd"
  Documentation: rev-list: change a few instances of "git-cmd" to "git cmd"
  checkout: Don't crash when switching away from an invalid branch.

16 years agobisect: fix missing "exit"
Christian Couder [Sun, 9 Nov 2008 14:25:55 +0000 (15:25 +0100)]
bisect: fix missing "exit"

Check to see given bad/good/skip sets are valid commit and to exit
otherwise was broken by 6a54d97 (bisect: remove "checkout_done" variable
used when checking merge bases, 2008-09-06).

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: bisect: change a few instances of "git-cmd" to "git cmd"
Christian Couder [Sun, 9 Nov 2008 13:53:14 +0000 (14:53 +0100)]
Documentation: bisect: change a few instances of "git-cmd" to "git cmd"

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: rev-list: change a few instances of "git-cmd" to "git cmd"
Christian Couder [Sun, 9 Nov 2008 13:46:35 +0000 (14:46 +0100)]
Documentation: rev-list: change a few instances of "git-cmd" to "git cmd"

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoreceive-pack: detect push to current branch of non-bare repo
Jeff King [Sun, 9 Nov 2008 01:49:27 +0000 (20:49 -0500)]
receive-pack: detect push to current branch of non-bare repo

Pushing into the currently checked out branch of a non-bare
repository can be dangerous; the HEAD then loses sync with
the index and working tree, and it looks in the receiving
repo as if the pushed changes have been reverted in the
index (since they were never there in the first place).

This patch adds a safety valve that checks for this
condition and either generates a warning or denies the
update. We trigger the check only on a non-bare repository,
since a bare repo does not have a working tree (and in fact,
pushing to the HEAD branch is a common workflow for
publishing repositories).

The behavior is configurable via receive.denyCurrentBranch,
defaulting to "warn" so as not to break existing setups
(though it may, after a deprecation period, switch to
"refuse" by default). For users who know what they are doing
and want to silence the warning (e.g., because they have a
post-receive hook that reconciles the HEAD and working
tree), they can turn off the warning by setting it to false
or "ignore".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot5516: refactor oddball tests
Jeff King [Fri, 7 Nov 2008 22:20:33 +0000 (17:20 -0500)]
t5516: refactor oddball tests

t5516 sets up some utility functions for starting each test
with a clean slate. However, there were a few tests added
that do not use these functions, but instead make their own
repositories.

Let's bring these in line with the rest of the tests. Not
only do we reduce the number of lines, but these tests will
benefit from any further enhancements to the utility
scripts.

The conversion is pretty straightforward. Most of the tests
created a parent/child clone relationship, for which we now
use 'testrepo' as the parent.  One test looked in testrepo,
but relied on previous tests to have set it up; it now sets
up testrepo explicitly, which makes it a bit more robust to
changes in the script, as well.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocheckout: Don't crash when switching away from an invalid branch.
Alexandre Julliard [Sat, 8 Nov 2008 12:03:59 +0000 (13:03 +0100)]
checkout: Don't crash when switching away from an invalid branch.

When using alternates, it is possible for HEAD to end up pointing to
an invalid commit. git checkout should be able to recover from that
situation without crashing.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'dev'
Paul Mackerras [Sun, 9 Nov 2008 11:05:50 +0000 (22:05 +1100)]
Merge branch 'dev'

16 years agoMerge branch 'maint'
Junio C Hamano [Sun, 9 Nov 2008 05:33:55 +0000 (21:33 -0800)]
Merge branch 'maint'

* maint:
  GIT 1.6.0.4
  Update RPM spec for the new location of git-cvsserver.
  push: fix local refs update if already up-to-date
  do not force write of packed refs

Conflicts:
builtin-revert.c

16 years agoGIT 1.6.0.4 v1.6.0.4
Junio C Hamano [Sun, 9 Nov 2008 01:33:50 +0000 (17:33 -0800)]
GIT 1.6.0.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate RPM spec for the new location of git-cvsserver.
Quy Tonthat [Fri, 12 Sep 2008 16:22:44 +0000 (02:22 +1000)]
Update RPM spec for the new location of git-cvsserver.

git-cvsserver has been moved from libexecdir to bindir.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'cb/maint-update-ref-fix' into maint
Junio C Hamano [Sun, 9 Nov 2008 01:32:49 +0000 (17:32 -0800)]
Merge branch 'cb/maint-update-ref-fix' into maint

* cb/maint-update-ref-fix:
  push: fix local refs update if already up-to-date
  do not force write of packed refs

16 years agoMerge branch 'cj/maint-gitpm-fix-maybe-self' into maint
Junio C Hamano [Sun, 9 Nov 2008 00:50:25 +0000 (16:50 -0800)]
Merge branch 'cj/maint-gitpm-fix-maybe-self' into maint

* cj/maint-gitpm-fix-maybe-self:
  Git.pm: do not break inheritance

16 years agoMerge branch 'ar/maint-mksnpath' into maint
Junio C Hamano [Sun, 9 Nov 2008 00:13:19 +0000 (16:13 -0800)]
Merge branch 'ar/maint-mksnpath' into maint

* ar/maint-mksnpath:
  Use git_pathdup instead of xstrdup(git_path(...))
  git_pathdup: returns xstrdup-ed copy of the formatted path
  Fix potentially dangerous use of git_path in ref.c
  Add git_snpath: a .git path formatting routine with output buffer
  Fix potentially dangerous uses of mkpath and git_path
  Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
  Add mksnpath which allows you to specify the output buffer

Conflicts:
builtin-revert.c
rerere.c

16 years agoMerge branch 'mv/maint-branch-m-symref' into maint
Junio C Hamano [Sun, 9 Nov 2008 00:07:37 +0000 (16:07 -0800)]
Merge branch 'mv/maint-branch-m-symref' into maint

* mv/maint-branch-m-symref:
  update-ref --no-deref -d: handle the case when the pointed ref is packed
  git branch -m: forbid renaming of a symref
  Fix git update-ref --no-deref -d.
  rename_ref(): handle the case when the reflog of a ref does not exist
  Fix git branch -m for symrefs.

16 years agoMerge branch 'ds/autoconf'
Junio C Hamano [Sun, 9 Nov 2008 00:05:49 +0000 (16:05 -0800)]
Merge branch 'ds/autoconf'

* ds/autoconf:
  autoconf: Add link tests to each AC_CHECK_FUNC() test

16 years agoMerge branch 'rs/blame'
Junio C Hamano [Sun, 9 Nov 2008 00:05:39 +0000 (16:05 -0800)]
Merge branch 'rs/blame'

* rs/blame:
  blame: use xdi_diff_hunks(), get rid of struct patch
  add xdi_diff_hunks() for callers that only need hunk lengths
  Allow alternate "low-level" emit function from xdl_diff
  Always initialize xpparam_t to 0
  blame: inline get_patch()

16 years agot5400: expect success for denying deletion
Jeff King [Fri, 7 Nov 2008 22:09:55 +0000 (17:09 -0500)]
t5400: expect success for denying deletion

Commit a240de11 introduced this test and the code to make it
successful.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoxdiff: give up scanning similar lines early
Davide Libenzi [Sat, 8 Nov 2008 05:24:33 +0000 (21:24 -0800)]
xdiff: give up scanning similar lines early

In a corner case of large files whose lines do not match uniquely, the
loop to eliminate a line that matches multiple locations adjacent to a run
of lines that do not uniquely match wasted too much cycles.  Fix this by
giving up early after scanning 100 lines in both direction.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitk: Implement a user-friendly Edit View dialog
Alexander Gavrilov [Sun, 2 Nov 2008 18:59:48 +0000 (21:59 +0300)]
gitk: Implement a user-friendly Edit View dialog

Originally gitk required the user to specify all limiting
options manually in the same field with the list of commits.
It is rather unfriendly for new users, who may not know
which options can be used, or, indeed, that it is possible
to specify them at all.

This commit modifies the dialog to present the most useful
options as individual fields.  Note that options that may
be useful to an extent, but produce a severely broken view,
are deliberately not included.

It is still possible to specify options in the commit list
field, but when the dialog is reopened, they will be extracted
into their own separate fields.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Improve cherry-pick error handling
Paul Mackerras [Sat, 8 Nov 2008 10:37:09 +0000 (21:37 +1100)]
gitk: Improve cherry-pick error handling

This adds to the regexps that are used to work out what sort of error
we encountered in trying to do a cherry-pick so that it recognizes
some additional common error messages.  It adds a confirmation dialog
when the error is a merge conflict so the user can choose whether or
not to run git citool.  Finally, it arranges to update the display
after a cherry-pick failed so that any local changes made by the
cherry-pick become visible.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Make cherry-pick call git-citool on conflicts
Alexander Gavrilov [Sun, 2 Nov 2008 18:59:47 +0000 (21:59 +0300)]
gitk: Make cherry-pick call git-citool on conflicts

Now that git-gui has facilities to help users resolve
conflicts, it makes sense to launch it from other GUI
tools when they happen.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Make gitk dialog windows transient
Alexander Gavrilov [Sun, 2 Nov 2008 18:59:45 +0000 (21:59 +0300)]
gitk: Make gitk dialog windows transient

Transient windows are always kept above their parent, and don't occupy
any space in the taskbar, which is useful for dialogs.  Also, when
transient is used, it is important to bind windows to the correct
parent.

This commit adds transient annotations to all dialogs, ensures usage
of the correct parent for error and confirmation popups, and, as a
side job, makes gitk preserve the create tag dialog window in case of
errors.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Add Return and Escape bindings to dialogs
Alexander Gavrilov [Sun, 2 Nov 2008 18:59:44 +0000 (21:59 +0300)]
gitk: Add Return and Escape bindings to dialogs

It is often more convenient to dismiss or accept a dialog using the
keyboard, than by clicking buttons on the screen.  This commit adds
key binding to make it possible with gitk's dialogs.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitweb: Fix mod_perl support.
Alexander Gavrilov [Wed, 5 Nov 2008 22:10:07 +0000 (01:10 +0300)]
gitweb: Fix mod_perl support.

ModPerl::Registry precompiles scripts by wrapping them
in a subroutine. This causes ordinary subroutines of the
script to become nested, and warnings appear:

gitweb.cgi: Variable "$path_info" will not stay shared

This warning means that $path_info was declared as 'my',
and thus according to the perl evaluation rules all nested
subroutines will retain a reference to the instance of the
variable used in the first invocation of the master script.

When the script (i.e. the master meta-subroutine) is executed
the second time, it will use a new instance, so the logic
breaks. To avoid this it is necessary to declare all global
variables as 'our', which places them at the package level.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Add a per-repository authorization hook.
Alexander Gavrilov [Wed, 5 Nov 2008 22:36:23 +0000 (01:36 +0300)]
gitweb: Add a per-repository authorization hook.

Add a configuration variable that can be used to specify an
arbitrary subroutine that will be called in the same situations
where $export_ok is checked, and its return value used
to decide whether the repository is to be shown.

This allows the user to implement custom authentication
schemes, for example by issuing a subrequest through mod_perl
and checking if Apache will authorize it.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Use single implementation of export_ok check.
Alexander Gavrilov [Wed, 5 Nov 2008 22:15:56 +0000 (01:15 +0300)]
gitweb: Use single implementation of export_ok check.

GitWeb source contains a special function that implements the
export_ok check, but validate_project still uses a separate copy
of essentially the same code.

This patch makes it use the dedicated function, thus ensuring
that all checks are done through a single code path.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoWindows: Make OpenSSH properly detect tty detachment.
Alexander Gavrilov [Sun, 2 Nov 2008 17:11:13 +0000 (20:11 +0300)]
Windows: Make OpenSSH properly detect tty detachment.

Apparently, CREATE_NO_WINDOW makes the OS tell the process
that it has a console, but without actually creating the
window. As a result, when git is started from GUI, ssh
tries to ask its questions on the invisible console.

This patch uses DETACHED_PROCESS instead, which clearly
means that the process should be left without a console.
The downside is that if the process manually calls
AllocConsole, the window will appear. A similar thing
might occur if it calls another console executable.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: proper detection of bare repositories
Deskin Miller [Thu, 6 Nov 2008 05:07:39 +0000 (00:07 -0500)]
git-svn: proper detection of bare repositories

When in a bare repository (or .git, for that matter), git-svn would fail
to initialise properly, since git rev-parse --show-cdup would not output
anything.  However, git rev-parse --show-cdup actually returns an error
code if it's really not in a git directory.

Fix the issue by checking for an explicit error from git rev-parse, and
setting $git_dir appropriately if instead it just does not output.

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn: respect i18n.commitencoding config
Eric Wong [Thu, 30 Oct 2008 06:49:26 +0000 (23:49 -0700)]
git-svn: respect i18n.commitencoding config

SVN itself always stores log messages in the repository as
UTF-8.  git always stores/retrieves everything as raw binary
data with no transformations whatsoever.

To interact with SVN, we need to encode log messages as UTF-8
before sending them to SVN, as SVN cannot do it for us.  When
retrieving log messages from SVN, we also need to (attempt to)
reencode the UTF-8 log message back to the user-specified commit
encoding.

Note, handling i18n.logoutputencoding for "git svn log" also
needs to be done in a future change.

Also, this change only deals with the encoding of commit
messages and nothing else (path names, blob content, ...).

In-Reply-To: <8b168cfb0810282014r789ac01dnec51824de1078f0@mail.gmail.com>
James North <tocapicha@gmail.com> wrote:
> Hi,
>
> I'm using git-svn on a system with ISO-8859-1 encoding. The problem is
> when I try to use "git svn dcommit" to send changes to a remote svn
> (also ISO-8859-1).
>
> Seems like git-svn is sending commit messages with utf-8 (just a
> guessing...) and they look bad on the remote svn log. E.g. "Ca?\241a
> de cami?\243n"
>
> I have tried using i18n.commitencoding=ISO-8859-1 as suggested by the
> warning when doing "git svn dcommit" but messages still are sent with
> wrong encoding.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn: don't escape tilde ('~') for http(s) URLs
Eric Wong [Tue, 21 Oct 2008 21:12:15 +0000 (14:12 -0700)]
git-svn: don't escape tilde ('~') for http(s) URLs

Thanks to Jose Carlos Garcia Sogo and Björn Steinbrink for the
bug report.

On 2008.10.18 23:39:19 +0200, Björn Steinbrink wrote:
> Hi,
>
> Jose Carlos Garcia Sogo reported on #git that a git-svn clone of this
> svn repo fails for him:
> https://sucs.org/~welshbyte/svn/backuptool/trunk
>
> I can reproduce that here with:
> git-svn version 1.6.0.2.541.g46dc1.dirty (svn 1.5.1)
>
> The error message I get is:
> Apache got a malformed URI: Unusable URI: it does not refer to this
> repository at /usr/local/libexec/git-core/git-svn line 4057
>
> strace revealed that git-svn url-encodes ~ while svn does not do that.
>
> For svn we have:
> write(5, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
> <S:src-path>https://sucs.org/~welshbyte/svn/backuptool/trunk</S:src-path>...
>
> While git-svn shows:
> write(7, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
> <S:src-path>https://sucs.org/%7Ewelshbyte/svn/backuptool/trunk</S:src-path>...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
16 years agopush: fix local refs update if already up-to-date
Clemens Buchacher [Wed, 5 Nov 2008 20:55:54 +0000 (21:55 +0100)]
push: fix local refs update if already up-to-date

git push normally updates local refs only after a successful push. If the
remote already has the updates -- pushed indirectly through another repository,
for example -- we forget to update local tracking refs.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodo not force write of packed refs
Clemens Buchacher [Wed, 5 Nov 2008 20:55:53 +0000 (21:55 +0100)]
do not force write of packed refs

We force writing a ref if it does not exist. Originally, we only had to look
for the ref file to check if it existed. Now we have to look for a packed ref
as well. Luckily, resolve_ref already does all the work for us.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoImplement git remote rename
Miklos Vajna [Mon, 3 Nov 2008 18:26:18 +0000 (19:26 +0100)]
Implement git remote rename

The new rename subcommand does the followings:

1) Renames the remote.foo configuration section to remote.bar

2) Updates the remote.bar.fetch refspecs

3) Updates the branch.*.remote settings

4) Renames the tracking branches: renames the normal refs and rewrites
   the symrefs to point to the new refs.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate draft release notes to 1.6.1
Junio C Hamano [Wed, 5 Nov 2008 20:20:55 +0000 (12:20 -0800)]
Update draft release notes to 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'ar/mksnpath'
Junio C Hamano [Wed, 5 Nov 2008 19:35:53 +0000 (11:35 -0800)]
Merge branch 'ar/mksnpath'

* ar/mksnpath:
  Use git_pathdup instead of xstrdup(git_path(...))
  git_pathdup: returns xstrdup-ed copy of the formatted path
  Fix potentially dangerous use of git_path in ref.c
  Add git_snpath: a .git path formatting routine with output buffer
  Fix potentially dangerous uses of mkpath and git_path
  Fix potentially dangerous uses of mkpath and git_path
  Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
  Add mksnpath which allows you to specify the output buffer

Conflicts:
builtin-revert.c