git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bhavik Bavishi <bhavikdbavishi@gmail.com>
To: git@vger.kernel.org
Subject: [Bug report] git cherry-pick silently ignores error whereas git apply fails for hunk apply
Date: Fri, 7 Nov 2025 10:09:32 +0530	[thread overview]
Message-ID: <CAEyHQXWd77_jJachC6FYbWMJ+L=KkKoUqiACQ7z8r-ZwYq8JYw@mail.gmail.com> (raw)

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
> ran git cherry-pick command, which went fine without any error, but missed to apply change
> created patch with 'git fromat-patch' and applied with 'git apply --verbose', which error for the issue

What did you expect to happen? (Expected behavior)
> git cherry-pick should fail, since it failed to apply hunk

What happened instead? (Actual behavior)
> git cherry-pick completed successfully without any error

What's different between what you expected and what actually happened?
> git apply --verbose, failed with error about the issue, whereas git cherry-pick didn't fail for the same

Anything else you want to add:
> same error observed with '2.51.2' version as well
> we do primarily use Gerrit UI for cherry-pick, so JGIT has similar behaviour as git cli for cherry-pick.

> can we have verbose mode for git cherry-pick, like git apply --verbose ?

> below is output of git apply (note I've changed words for source code references)
=======================================================================
git apply --verbose ../test.patch
Checking patch mango/connectors/apple/ops/query_check_hierarchy_op.cc...
Checking patch mango/connectors/container/loc_base/util.cc...
Checking patch mango/connectors/container/loc_base/util.h...
Checking patch mango/main/http_test_ops/new_op.cc...
Hunk #1 succeeded at 56 (offset 2 lines).
Hunk #2 succeeded at 1074 (offset 21 lines).
Checking patch mango/main/main.cc...
Hunk #1 succeeded at 9876 (offset -63 lines).
Checking patch mango/main/ops/refresh_apple_hierarchy_op.cc...
Hunk #4 succeeded at 1713 (offset 18 lines).
Checking patch mango/main/validation_util.cc...
Hunk #1 succeeded at 42 (offset -1 lines).
Hunk #2 succeeded at 106 (offset -2 lines).
Hunk #3 succeeded at 11167 (offset -14 lines).
Checking patch mango/conn/ops/apple_box_storage_package_op.cc...
Checking patch mango/utils/apple_utils.cc...
error: while searching for:

//-----------------------------------------------------------------------------

// Returns true if Apple Box Pack usecases + the corresponding updates flag
// is enabled.
bool Converter::IsAppleBoxPackEnabled(
    std::shared_ptr<const orange::FeatureEnabler> updates_checks,
    std::shared_ptr<const mango::RegisteredParams>
        newed_params) {
  for (const auto& usecase :
       newed_params->apple_params().use_cases()) {
    if ((usecase == RegisteredAppleParams_UseCase_kBoxPack) &&
        updates_checks->updates_list_map()
            .apple_box_storage_protection_enabled()) {
      return true;
    }
  }
  return false;
}

//-----------------------------------------------------------------------------

}}}  // namespace org::mango::apple

error: patch failed: mango/utils/apple_utils.cc:658
error: mango/utils/apple_utils.cc: patch does not apply
Checking patch mango/utils/apple_utils.h...
=======================================================================

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.34.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC
2025 x86_64
compiler info: gnuc: 11.4
libc info: glibc: 2.35
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
commit-msg


             reply	other threads:[~2025-11-07  4:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07  4:39 Bhavik Bavishi [this message]
2025-11-07  6:37 ` [Bug report] git cherry-pick silently ignores error whereas git apply fails for hunk apply Johannes Sixt
2025-11-07  8:35   ` Bhavik Bavishi
2025-11-08  3:44     ` Bhavik Bavishi
2025-11-08  8:26       ` Johannes Sixt
2025-11-08 10:57     ` Chris Torek
2025-11-09 10:09       ` Bhavik Bavishi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEyHQXWd77_jJachC6FYbWMJ+L=KkKoUqiACQ7z8r-ZwYq8JYw@mail.gmail.com' \
    --to=bhavikdbavishi@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).