Remove "remember-last-answer" from Breeze/CI
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e9e3954e34751..f880e3b1d9c20 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -735,7 +735,7 @@ repos:
         # The below pre-commits are those requiring CI image to be built
       - id: build
         name: Check if image build is needed
-        entry: ./scripts/ci/pre_commit/pre_commit_ci_build.sh 3.7 false
+        entry: ./scripts/ci/pre_commit/pre_commit_ci_build.sh 3.7
         language: system
         always_run: true
         pass_filenames: false
diff --git a/breeze b/breeze
index 93ac65ab253c6..269cf9077e5b5 100755
--- a/breeze
+++ b/breeze
@@ -3605,8 +3605,6 @@ breeze::parse_arguments "${@}"
 
 breeze::print_header_line
 
-build_images::forget_last_answer
-
 breeze::check_and_save_all_params
 
 build_images::determine_docker_cache_strategy
diff --git a/dev/breeze/src/airflow_breeze/global_constants.py b/dev/breeze/src/airflow_breeze/global_constants.py
index b8db092157adf..5ae0843578b49 100644
--- a/dev/breeze/src/airflow_breeze/global_constants.py
+++ b/dev/breeze/src/airflow_breeze/global_constants.py
@@ -24,7 +24,6 @@
 FORCE_PULL_IMAGES = False
 CHECK_IF_BASE_PYTHON_IMAGE_UPDATED = False
 FORCE_BUILD_IMAGES = False
-# LAST_FORCE_ANSWER_FILE = f"{BUILD_CACHE_DIR}/last_force_answer.sh"
 FORCE_ANSWER_TO_QUESTION = ""
 SKIP_CHECK_REMOTE_IMAGE = False
 PUSH_PYTHON_BASE_IMAGE = False
diff --git a/scripts/ci/libraries/_build_images.sh b/scripts/ci/libraries/_build_images.sh
index f098169577875..796fac02002dc 100644
--- a/scripts/ci/libraries/_build_images.sh
+++ b/scripts/ci/libraries/_build_images.sh
@@ -87,36 +87,6 @@ function build_images::get_airflow_version_from_production_image() {
     docker run --entrypoint /bin/bash "${AIRFLOW_PROD_IMAGE}" -c 'echo "${AIRFLOW_VERSION}"'
 }
 
-# Removes the "Forced answer" (yes/no/quit) given previously, unless you specifically want to remember it.
-#
-# This is the default behaviour of all rebuild scripts to ask independently whether you want to
-# rebuild the image or not. Sometimes however we want to remember answer previously given. For
-# example if you answered "no" to rebuild the image, the assumption is that you do not
-# want to rebuild image also for other rebuilds in the same pre-commit execution.
-#
-# All the pre-commit checks therefore have `export REMEMBER_LAST_ANSWER="true"` set
-# So that in case they are run in a sequence of commits they will not rebuild. Similarly if your most
-# recent answer was "no" and you run `pre-commit run mypy` (for example) it will also reuse the
-# "no" answer given previously. This happens until you run any of the breeze commands or run all
-# pre-commits `pre-commit run` - then the "LAST_FORCE_ANSWER_FILE" will be removed and you will
-# be asked again.
-function build_images::forget_last_answer() {
-    if [[ ${REMEMBER_LAST_ANSWER:="false"} != "true" ]]; then
-        verbosity::print_info
-        verbosity::print_info "Forgetting last answer from ${LAST_FORCE_ANSWER_FILE}:"
-        verbosity::print_info
-        rm -f "${LAST_FORCE_ANSWER_FILE}"
-    else
-        if [[ -f "${LAST_FORCE_ANSWER_FILE}" ]]; then
-            verbosity::print_info
-            verbosity::print_info "Still remember last answer from ${LAST_FORCE_ANSWER_FILE}:"
-            verbosity::print_info "$(cat "${LAST_FORCE_ANSWER_FILE}")"
-            verbosity::print_info
-        fi
-    fi
-}
-
-
 function build_images::reconfirm_rebuilding_if_not_rebased() {
     local latest_main_commit_sha
     latest_main_commit_sha=$(curl -s -H "Accept: application/vnd.github.VERSION.sha" \
@@ -178,12 +148,6 @@ function build_images::confirm_rebuilding_on_modified_files() {
 # So that the script works also from within pre-commit run via git hooks - where stdin is not
 # available - it tries to find usable terminal and ask the user via this terminal.
 function build_images::confirm_image_rebuild() {
-    if [[ -f "${LAST_FORCE_ANSWER_FILE}" ]]; then
-        # set variable from last answered response given in the same pre-commit run - so that it can be
-        # answered in the first pre-commit check (build) and then used in another (mypy/flake8 etc).
-        # shellcheck disable=SC1090
-        source "${LAST_FORCE_ANSWER_FILE}"
-    fi
     set +e
     local RES
     if [[ ${CI:="false"} == "true" ]]; then
@@ -235,7 +199,6 @@ function build_images::confirm_image_rebuild() {
         # Force "no" also to subsequent questions so that if you answer it once, you are not asked
         # For all other pre-commits and you will continue using the images you already have
         export FORCE_ANSWER_TO_QUESTIONS="no"
-        echo 'export FORCE_ANSWER_TO_QUESTIONS="no"' >"${LAST_FORCE_ANSWER_FILE}"
     elif [[ ${RES} == "2" ]]; then
         echo
         echo  "${COLOR_RED}ERROR: The ${THE_IMAGE_TYPE} needs to be rebuilt - it is outdated.   ${COLOR_RESET}"
diff --git a/scripts/ci/libraries/_initialization.sh b/scripts/ci/libraries/_initialization.sh
index 5c9d239ef75a3..7809b4b2bab0b 100644
--- a/scripts/ci/libraries/_initialization.sh
+++ b/scripts/ci/libraries/_initialization.sh
@@ -294,11 +294,6 @@ function initialization::initialize_force_variables() {
     # Can be overridden by '--force-build-images' flag.
     export FORCE_BUILD_IMAGES=${FORCE_BUILD_IMAGES:="false"}
 
-    # File to keep the last forced answer. This is useful for pre-commits where you need to
-    # only answer once if the image should be rebuilt or not and your answer is used for
-    # All the subsequent questions
-    export LAST_FORCE_ANSWER_FILE="${BUILD_CACHE_DIR}/last_force_answer.sh"
-
     # Can be set to "yes/no/quit" in order to force specified answer to all questions asked to the user.
     export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:=""}
 
diff --git a/scripts/ci/pre_commit/pre_commit_bat_tests.sh b/scripts/ci/pre_commit/pre_commit_bat_tests.sh
index 58078623552cb..499972609da6d 100755
--- a/scripts/ci/pre_commit/pre_commit_bat_tests.sh
+++ b/scripts/ci/pre_commit/pre_commit_bat_tests.sh
@@ -16,7 +16,6 @@
 # specific language governing permissions and limitations
 # under the License.
 export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:="quit"}
-export REMEMBER_LAST_ANSWER="true"
 export PRINT_INFO_FROM_SCRIPTS="false"
 export SKIP_CHECK_REMOTE_IMAGE="true"
 
diff --git a/scripts/ci/pre_commit/pre_commit_check_license.sh b/scripts/ci/pre_commit/pre_commit_check_license.sh
index 5eb42b6d985ab..b9ab60067bbbc 100755
--- a/scripts/ci/pre_commit/pre_commit_check_license.sh
+++ b/scripts/ci/pre_commit/pre_commit_check_license.sh
@@ -17,7 +17,6 @@
 # under the License.
 set -euo pipefail
 export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:="quit"}
-export REMEMBER_LAST_ANSWER="true"
 export PRINT_INFO_FROM_SCRIPTS="false"
 export SKIP_CHECK_REMOTE_IMAGE="true"
 
diff --git a/scripts/ci/pre_commit/pre_commit_ci_build.sh b/scripts/ci/pre_commit/pre_commit_ci_build.sh
index 066380107714f..55d0aac23a8e9 100755
--- a/scripts/ci/pre_commit/pre_commit_ci_build.sh
+++ b/scripts/ci/pre_commit/pre_commit_ci_build.sh
@@ -16,7 +16,6 @@
 # specific language governing permissions and limitations
 # under the License.
 export PYTHON_MAJOR_MINOR_VERSION="${1}"
-export REMEMBER_LAST_ANSWER="${2}"
 export PRINT_INFO_FROM_SCRIPTS="false"
 
 # shellcheck source=scripts/ci/libraries/_script_init.sh
@@ -50,8 +49,6 @@ function build_images::rebuild_ci_image_if_confirmed_for_pre_commit() {
     fi
 }
 
-build_images::forget_last_answer
-
 build_images::prepare_ci_build
 
 build_images::rebuild_ci_image_if_confirmed_for_pre_commit
diff --git a/scripts/ci/pre_commit/pre_commit_flake8.sh b/scripts/ci/pre_commit/pre_commit_flake8.sh
index cbef9d08bce23..4138478b7ae93 100755
--- a/scripts/ci/pre_commit/pre_commit_flake8.sh
+++ b/scripts/ci/pre_commit/pre_commit_flake8.sh
@@ -17,7 +17,6 @@
 # under the License.
 export PYTHON_MAJOR_MINOR_VERSION="3.7"
 export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:="quit"}
-export REMEMBER_LAST_ANSWER="true"
 export PRINT_INFO_FROM_SCRIPTS="false"
 
 # shellcheck source=scripts/ci/static_checks/flake8.sh
diff --git a/scripts/ci/pre_commit/pre_commit_helm_lint.sh b/scripts/ci/pre_commit/pre_commit_helm_lint.sh
index 56a57f3555d95..c8f2a5befdd99 100755
--- a/scripts/ci/pre_commit/pre_commit_helm_lint.sh
+++ b/scripts/ci/pre_commit/pre_commit_helm_lint.sh
@@ -15,7 +15,6 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-export REMEMBER_LAST_ANSWER="true"
 export PRINT_INFO_FROM_SCRIPTS="false"
 export SKIP_CHECK_REMOTE_IMAGE="true"
 
diff --git a/scripts/ci/pre_commit/pre_commit_in_container_bats_test.sh b/scripts/ci/pre_commit/pre_commit_in_container_bats_test.sh
index b699a54361234..fe1d7e7cba1c5 100755
--- a/scripts/ci/pre_commit/pre_commit_in_container_bats_test.sh
+++ b/scripts/ci/pre_commit/pre_commit_in_container_bats_test.sh
@@ -16,7 +16,6 @@
 # specific language governing permissions and limitations
 # under the License.
 export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:="quit"}
-export REMEMBER_LAST_ANSWER="true"
 export PRINT_INFO_FROM_SCRIPTS="false"
 export SKIP_CHECK_REMOTE_IMAGE="true"
 
diff --git a/scripts/ci/pre_commit/pre_commit_lint_dockerfile.sh b/scripts/ci/pre_commit/pre_commit_lint_dockerfile.sh
index 1c0697803ca29..90dc7e0cdbb45 100755
--- a/scripts/ci/pre_commit/pre_commit_lint_dockerfile.sh
+++ b/scripts/ci/pre_commit/pre_commit_lint_dockerfile.sh
@@ -15,7 +15,6 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-export REMEMBER_LAST_ANSWER="true"
 export PRINT_INFO_FROM_SCRIPTS="false"
 export SKIP_CHECK_REMOTE_IMAGE="true"
 
diff --git a/scripts/ci/pre_commit/pre_commit_mypy.sh b/scripts/ci/pre_commit/pre_commit_mypy.sh
index 5f3198e15b0b4..7abd6b4bb796b 100755
--- a/scripts/ci/pre_commit/pre_commit_mypy.sh
+++ b/scripts/ci/pre_commit/pre_commit_mypy.sh
@@ -17,7 +17,6 @@
 # under the License.
 export PYTHON_MAJOR_MINOR_VERSION="3.7"
 export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:="quit"}
-export REMEMBER_LAST_ANSWER="true"
 export PRINT_INFO_FROM_SCRIPTS="false"
 
 # shellcheck source=scripts/ci/static_checks/mypy.sh

This feature had been removed when recent BUILDX improvements
were added. This PR removes the remnants of it.

Follow up after #20664

<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.

Feel free to ping committers for the review!

In case of existing issue, reference it using one of the following:

closes: #ISSUE
related: #ISSUE

How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->

---
**^ Add meaningful description above**

Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
