1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-22 14:19:04 +02:00
Commit Graph

48497 Commits

Author SHA1 Message Date
Kevin Willford 738e88a20c format-patch: have progress option while generating patches
When generating patches for the rebase command, if the user does
not realize the branch they are rebasing onto is thousands of
commits different, there is no progress indication after initial
rewinding message.

The progress meter as presented in this patch assumes the thousands of
patches to have a fine granularity as well as assuming to require all
the same amount of work/time for each, such that a steady progress bar
is achieved.

We do not want to estimate the time for each patch based e.g.
on their size or number of touched files (or parents) as that is too
expensive for just a progress meter.

This patch allows a progress option to be passed to format-patch
so that the user can be informed the progress of generating the
patch.  This option is then used by the rebase command when
calling format-patch.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14 14:09:45 -07:00
René Scharfe 5c377d3d59 tree-walk: convert fill_tree_descriptor() to object_id
All callers of fill_tree_descriptor() have been converted to object_id
already, so convert that function as well.  As a nice side-effect we get
rid of NULL checks in tree-diff.c, as fill_tree_descriptor() already
does them for us.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14 12:38:54 -07:00
Jonathan Tan 23b65f9528 diff: avoid redundantly clearing a flag
No code in diff.c sets DIFF_SYMBOL_MOVED_LINE except in
mark_color_as_moved(), so it is redundant to clear it for the current
line. Therefore, clear it only for previous lines.

This makes a refactoring in a subsequent patch easier.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14 12:28:36 -07:00
Paolo Bonzini c88bf5436d interpret-trailers: fix documentation typo
Self-explanatory... trailer.ifexists is documented with the
right name, but after a while it switches to ifexist.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14 12:23:28 -07:00
Paolo Bonzini 0ea5292e6b interpret-trailers: add options for actions
Allow using non-default values for trailers without having to set
them up in .gitconfig first.  For example, if you have the following
configuration

     trailer.signed-off-by.where = end

you may use "--where before" when a patch author forgets his
Signed-off-by and provides it in a separate email.  Likewise for
--if-exists and --if-missing

Reverting to the behavior specified by .gitconfig is done with
--no-where, --no-if-exists and --no-if-missing.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14 12:23:28 -07:00
Paolo Bonzini 51166b8754 trailers: introduce struct new_trailer_item
This will provide a place to store the current state of the
--where, --if-exists and --if-missing options.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14 12:23:28 -07:00
Kaartic Sivaraam 51f5a2b439 hook: use correct logical variable
Sign-off added should be that of the "committer", not that of the
"commit's author"; that is how the rest of Git adds sign-off using
sequencer.c::append_signoff().

Use the correct logical variable that identifies the committer.

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14 11:19:50 -07:00
Tom G. Christensen dd5df538b5 http: use a feature check to enable GSSAPI delegation control
Turn the version check into a feature check to ensure this functionality
is also enabled with vendor supported curl versions where the feature
may have been backported.

Signed-off-by: Tom G. Christensen <tgc@jupiterrise.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11 15:12:41 -07:00
Tom G. Christensen f18777ba6e http: fix handling of missing CURLPROTO_*
Commit aeae4db1 refactored the handling of the curl protocol
restriction support into a function but failed to add a version
check for older versions of curl that lack CURLPROTO_* support.

Add the missing check and at the same time convert it to a feature
check instead of a version based check.  This is done to ensure that
vendor supported curl versions that have had CURLPROTO_* support
backported are handled correctly.

Signed-off-by: Tom G. Christensen <tgc@jupiterrise.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11 15:12:07 -07:00
Nicolas Morey-Chaisemartin bbffd87d32 stash: clean untracked files before reset
If calling git stash -u on a repo that contains a file that is not
ignored any more due to a current modification of the gitignore file,
this file is stashed but not remove from the working tree.
This is due to git-stash first doing a reset --hard which clears the
.gitignore file modification and the call git clean, leaving the file
untouched.
This causes git stash pop to fail due to the file existing.

This patch simply switches the order between cleaning and resetting
and adds a test for this usecase.

Reported-by: Sam Partington <sam@whiteoctober.co.uk>
Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11 15:11:30 -07:00
Jonathan Tan 789bf26b07 sha1_file: remove read_packed_sha1()
Use read_object() in its place instead. This avoids duplication of code.

This makes force_object_loose() slightly slower (because of a redundant
check of loose object storage), but only in the error case.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11 15:07:01 -07:00
Jonathan Tan 3ab0fb0646 sha1_file: set whence in storage-specific info fn
Move the setting of oi->whence to sha1_loose_object_info() and
packed_object_info().

This allows sha1_object_info_extended() to not need to know about the
delta base cache. This will be useful during a future refactoring in
which packfile-related functions, including the handling of the delta
base cache, will be moved to a separate file.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11 14:35:02 -07:00
Junio C Hamano b3622a4ee9 The first batch of topics after the 2.14 cycle
Notably, let's declare that we aim to make "git add ''" illegal in
the cycle after this one.

The topic to do so, ex/deprecate-empty-pathspec-as-match-all, has
been cooking in 'next' too long, and will stay there during this
cycle, but not after.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11 13:34:31 -07:00
Junio C Hamano 297872f0c2 Merge branch 'ma/pager-per-subcommand-action'
The "tag.pager" configuration variable was useless for those who
actually create tag objects, as it interfered with the use of an
editor.  A new mechanism has been introduced for commands to enable
pager depending on what operation is being carried out to fix this,
and then "git tag -l" is made to run pager by default.

* ma/pager-per-subcommand-action:
  git.c: ignore pager.* when launching builtin as dashed external
  tag: change default of `pager.tag` to "on"
  tag: respect `pager.tag` in list-mode only
  t7006: add tests for how git tag paginates
  git.c: provide setup_auto_pager()
  git.c: let builtins opt for handling `pager.foo` themselves
  builtin.h: take over documentation from api-builtin.txt
2017-08-11 13:27:07 -07:00
Junio C Hamano 8fbaf0b13b Merge branch 'jk/rev-list-empty-input'
"git log --tag=no-such-tag" showed log starting from HEAD, which
has been fixed---it now shows nothing.

* jk/rev-list-empty-input:
  revision: do not fallback to default when rev_input_given is set
  rev-list: don't show usage when we see empty ref patterns
  revision: add rev_input_given flag
  t6018: flesh out empty input/output rev-list tests
2017-08-11 13:27:07 -07:00
Junio C Hamano 9c1259a0da Merge branch 'jt/t1450-fsck-corrupt-packfile'
A test update.

* jt/t1450-fsck-corrupt-packfile:
  tests: ensure fsck fails on corrupt packfiles
2017-08-11 13:27:07 -07:00
Junio C Hamano 40dc8d3dcf Merge branch 'js/git-gui-msgfmt-on-windows'
Because recent Git for Windows do come with a real msgfmt, the
build procedure for git-gui has been updated to use it instead of a
hand-rolled substitute.

* js/git-gui-msgfmt-on-windows:
  git-gui (MinGW): make use of MSys2's msgfmt
  git gui: allow for a long recentrepo list
  git gui: de-dup selected repo from recentrepo history
  git gui: cope with duplicates in _get_recentrepo
  git-gui: remove duplicate entries from .gitconfig's gui.recentrepo
2017-08-11 13:27:06 -07:00
Junio C Hamano 6d2b8a390c Merge branch 'eb/contacts-reported-by'
"git contacts" (in contrib/) now lists the address on the
"Reported-by:" trailer to its output, in addition to those on
S-o-b: and other trailers, to make it easier to notify (and thank)
the original bug reporter.

* eb/contacts-reported-by:
  git-contacts: also recognise "Reported-by:"
2017-08-11 13:27:06 -07:00
Junio C Hamano 838eaa9a22 Merge branch 'dl/credential-cache-socket-in-xdg-cache'
A recently added test for the "credential-cache" helper revealed
that EOF detection done around the time the connection to the cache
daemon is torn down were flaky.  This was fixed by reacting to
ECONNRESET and behaving as if we got an EOF.

* dl/credential-cache-socket-in-xdg-cache:
  credential-cache: interpret an ECONNRESET as an EOF
2017-08-11 13:27:06 -07:00
Junio C Hamano aec68c3dde Merge branch 'rg/rerere-train-overwrite'
The "rerere-train" script (in contrib/) learned the "--overwrite"
option to allow overwriting existing recorded resolutions.

* rg/rerere-train-overwrite:
  contrib/rerere-train: optionally overwrite existing resolutions
2017-08-11 13:27:05 -07:00
Junio C Hamano 18965625b9 Merge branch 'jb/t8008-cleanup'
Code clean-up.

* jb/t8008-cleanup:
  t8008: rely on rev-parse'd HEAD instead of sha1 value
2017-08-11 13:27:05 -07:00
Junio C Hamano 9a8ff899ce Merge branch 'jt/subprocess-handshake'
Code cleanup.

* jt/subprocess-handshake:
  sub-process: refactor handshake to common function
  Documentation: migrate sub-process docs to header
2017-08-11 13:27:05 -07:00
Junio C Hamano a449130a00 Merge branch 'dc/fmt-merge-msg-microcleanup'
Code cleanup.

* dc/fmt-merge-msg-microcleanup:
  fmt-merge-msg: fix coding style
2017-08-11 13:27:05 -07:00
Junio C Hamano 4c244c25f0 Merge branch 'ah/doc-wserrorhighlight'
Doc update.

* ah/doc-wserrorhighlight:
  doc: add missing values "none" and "default" for diff.wsErrorHighlight
2017-08-11 13:27:04 -07:00
Junio C Hamano afb456a383 Merge branch 'cc/ref-is-hidden-microcleanup'
Code cleanup.

* cc/ref-is-hidden-microcleanup:
  refs: use skip_prefix() in ref_is_hidden()
2017-08-11 13:27:03 -07:00
Junio C Hamano 4a636e7682 Merge branch 'js/run-process-parallel-api-fix'
API fix.

* js/run-process-parallel-api-fix:
  run_processes_parallel: change confusing task_cb convention
2017-08-11 13:27:02 -07:00
Junio C Hamano a6ca9ee9e0 Merge branch 'hb/gitweb-project-list'
When a directory is not readable, "gitweb" fails to build the
project list.  Work this around by skipping such a directory.

* hb/gitweb-project-list:
  gitweb: skip unreadable subdirectories
2017-08-11 13:27:01 -07:00
Junio C Hamano 2b473ce78c Merge branch 'ks/commit-abort-on-empty-message-fix'
"git commit" when seeing an totally empty message said "you did not
edit the message", which is clearly wrong.  The message has been
corrected.

* ks/commit-abort-on-empty-message-fix:
  commit: check for empty message before the check for untouched template
2017-08-11 13:27:01 -07:00
Junio C Hamano 55c965f3a2 Merge branch 'sb/hashmap-cleanup'
Many uses of comparision callback function the hashmap API uses
cast the callback function type when registering it to
hashmap_init(), which defeats the compile time type checking when
the callback interface changes (e.g. gaining more parameters).
The callback implementations have been updated to take "void *"
pointers and cast them to the type they expect instead.

* sb/hashmap-cleanup:
  t/helper/test-hashmap: use custom data instead of duplicate cmp functions
  name-hash.c: drop hashmap_cmp_fn cast
  submodule-config.c: drop hashmap_cmp_fn cast
  remote.c: drop hashmap_cmp_fn cast
  patch-ids.c: drop hashmap_cmp_fn cast
  convert/sub-process: drop cast to hashmap_cmp_fn
  config.c: drop hashmap_cmp_fn cast
  builtin/describe: drop hashmap_cmp_fn cast
  builtin/difftool.c: drop hashmap_cmp_fn cast
  attr.c: drop hashmap_cmp_fn cast
2017-08-11 13:27:01 -07:00
Junio C Hamano 3ab01ac3f7 Merge branch 'jk/reflog-walk'
Numerous bugs in walking of reflogs via "log -g" and friends have
been fixed.

* jk/reflog-walk:
  reflog-walk: apply --since/--until to reflog dates
  reflog-walk: stop using fake parents
  rev-list: check reflog_info before showing usage
  get_revision_1(): replace do-while with an early return
  log: do not free parents when walking reflog
  log: clarify comment about reflog cycles
  revision: disallow reflog walking with revs->limited
  t1414: document some reflog-walk oddities
2017-08-11 13:27:01 -07:00
Junio C Hamano 51b8aecabe Merge branch 'ls/filter-process-delayed'
The filter-process interface learned to allow a process with long
latency give a "delayed" response.

* ls/filter-process-delayed:
  convert: add "status=delayed" to filter process protocol
  convert: refactor capabilities negotiation
  convert: move multiple file filter error handling to separate function
  convert: put the flags field before the flag itself for consistent style
  t0021: write "OUT <size>" only on success
  t0021: make debug log file name configurable
  t0021: keep filter log files on comparison
2017-08-11 13:27:00 -07:00
Junio C Hamano a6f1456380 Merge branch 'st/lib-gpg-kill-stray-agent'
Some versions of GnuPG fails to kill gpg-agent it auto-spawned
and such a left-over agent can interfere with a test.  Work it
around by attempting to kill one before starting a new test.

* st/lib-gpg-kill-stray-agent:
  t: lib-gpg: flush gpg agent on startup
2017-08-11 13:27:00 -07:00
Junio C Hamano e57856502d Merge branch 'rs/pack-objects-pbase-cleanup'
Code clean-up.

* rs/pack-objects-pbase-cleanup:
  pack-objects: remove unnecessary NULL check
2017-08-11 13:27:00 -07:00
Junio C Hamano 2c40c6a77f Merge branch 'jt/fsck-code-cleanup'
Code clean-up.

* jt/fsck-code-cleanup:
  fsck: cleanup unused variable
  object: remove "used" field from struct object
  fsck: remove redundant parse_tree() invocation
2017-08-11 13:27:00 -07:00
Junio C Hamano 17b1e1d76c Merge branch 'jc/http-sslkey-and-ssl-cert-are-paths'
The http.{sslkey,sslCert} configuration variables are to be
interpreted as a pathname that honors "~[username]/" prefix, but
weren't, which has been fixed.

* jc/http-sslkey-and-ssl-cert-are-paths:
  http.c: http.sslcert and http.sslkey are both pathnames
2017-08-11 13:26:59 -07:00
Junio C Hamano e72ecd324c Merge branch 'jk/c99'
Start using selected c99 constructs in small, stable and
essentialpart of the system to catch people who care about
older compilers that do not grok them.

* jk/c99:
  clean.c: use designated initializer
  strbuf: use designated initializers in STRBUF_INIT
2017-08-11 13:26:58 -07:00
Junio C Hamano 15595ce438 Merge branch 'jk/ref-filter-colors'
"%C(color name)" in the pretty print format always produced ANSI
color escape codes, which was an early design mistake.  They now
honor the configuration (e.g. "color.ui = never") and also tty-ness
of the output medium.

* jk/ref-filter-colors:
  ref-filter: consult want_color() before emitting colors
  pretty: respect color settings for %C placeholders
  rev-list: pass diffopt->use_colors through to pretty-print
  for-each-ref: load config earlier
  color: check color.ui in git_default_config()
  ref-filter: pass ref_format struct to atom parsers
  ref-filter: factor out the parsing of sorting atoms
  ref-filter: make parse_ref_filter_atom a private function
  ref-filter: provide a function for parsing sort options
  ref-filter: move need_color_reset_at_eol into ref_format
  ref-filter: abstract ref format into its own struct
  ref-filter: simplify automatic color reset
  t: use test_decode_color rather than literal ANSI codes
  docs/for-each-ref: update pointer to color syntax
  check return value of verify_ref_format()
2017-08-11 13:26:58 -07:00
Junio C Hamano 076eeec8be Merge branch 'wd/rebase-conflict-guide'
The advice message given when "git rebase" stops for conflicting
changes has been improved.

* wd/rebase-conflict-guide:
  rebase: make resolve message clearer for inexperienced users
2017-08-11 13:26:58 -07:00
Junio C Hamano 12deaf66d4 Merge branch 'rs/stat-data-unaligned-reads-fix'
Code clean-up.

* rs/stat-data-unaligned-reads-fix:
  dir: support platforms that require aligned reads
2017-08-11 13:26:58 -07:00
Junio C Hamano 32f90258bd Merge branch 'rs/move-array'
Code clean-up.

* rs/move-array:
  ls-files: don't try to prune an empty index
  apply: use COPY_ARRAY and MOVE_ARRAY in update_image()
  use MOVE_ARRAY
  add MOVE_ARRAY
2017-08-11 13:26:57 -07:00
Junio C Hamano c2bfd0f9cb Merge branch 'rs/bswap-ubsan-fix'
Code clean-up.

* rs/bswap-ubsan-fix:
  bswap: convert get_be16, get_be32 and put_be32 to inline functions
  bswap: convert to unsigned before shifting in get_be32
2017-08-11 13:26:57 -07:00
Junio C Hamano 127f98f42b Merge branch 'ks/prepare-commit-msg-sample'
Remove an example that is now obsolete from a sample hook,
and improve an old example in it that added a sign-off manually
to use the interpret-trailers command.

* ks/prepare-commit-msg-sample:
  hook: add a simple first example
  hook: add sign-off using "interpret-trailers"
  hook: name the positional variables
  hook: cleanup script
2017-08-11 13:26:56 -07:00
Junio C Hamano c7528f4d8a Merge branch 'bw/object-id'
Conversion from uchar[20] to struct object_id continues.

* bw/object-id:
  receive-pack: don't access hash of NULL object_id pointer
  notes: don't access hash of NULL object_id pointer
  tree-diff: don't access hash of NULL object_id pointer
2017-08-11 13:26:56 -07:00
Junio C Hamano df422678a8 Merge branch 'bc/object-id'
Conversion from uchar[20] to struct object_id continues.

* bc/object-id:
  sha1_name: convert uses of 40 to GIT_SHA1_HEXSZ
  sha1_name: convert GET_SHA1* flags to GET_OID*
  sha1_name: convert get_sha1* to get_oid*
  Convert remaining callers of get_sha1 to get_oid.
  builtin/unpack-file: convert to struct object_id
  bisect: convert bisect_checkout to struct object_id
  builtin/update_ref: convert to struct object_id
  sequencer: convert to struct object_id
  remote: convert struct push_cas to struct object_id
  submodule: convert submodule config lookup to use object_id
  builtin/merge-tree: convert remaining caller of get_sha1 to object_id
  builtin/fsck: convert remaining caller of get_sha1 to object_id
2017-08-11 13:26:55 -07:00
Junio C Hamano 3943f6caaa Merge branch 'sb/object-id'
Conversion from uchar[20] to struct object_id continues.

* sb/object-id:
  tag: convert gpg_verify_tag to use struct object_id
  commit: convert lookup_commit_graft to struct object_id
2017-08-11 13:26:55 -07:00
René Scharfe 896dca3ab7 sha1_file: release delta_stack on error in unpack_entry()
When unpack_entry() encounters a broken packed object, it returns early.
It adjusts the reference count of the pack window, but leaks the buffer
for a big delta stack in case the small automatic one was not enough.
Jump to the cleanup code at end instead, which takes care of that.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-10 15:42:46 -07:00
René Scharfe 83cd6f9017 fsck: free buffers on error in fsck_obj()
Move the code for releasing tree buffers and commit buffers in
fsck_obj() to the end of the function and make sure it's executed no
matter of an error is encountered or not.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-10 15:40:55 -07:00
René Scharfe 642956cf45 strbuf: clear errno before calling getdelim(3)
getdelim(3) returns -1 at the end of the file and if it encounters an
error, but sets errno only in the latter case.  Set errno to zero before
calling it to avoid misdiagnosing an out-of-memory condition due to a
left-over value from some other function call.

Reported-by: Yaroslav Halchenko <yoh@onerussian.com>
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-10 14:41:51 -07:00
René Scharfe 149d8cbb2e win32: plug memory leak on realloc() failure in syslog()
If realloc() fails then the original buffer is still valid.  Free it
before exiting the function.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-10 13:57:52 -07:00
René Scharfe de3ce210ed merge: use skip_prefix()
Get rid of a magic string length constant by using skip_prefix() instead
of starts_with().

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-10 13:57:00 -07:00