-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathresolve_conflicts.sh
More file actions
executable file
·39 lines (28 loc) · 1.25 KB
/
Copy pathresolve_conflicts.sh
File metadata and controls
executable file
·39 lines (28 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
gi#!/bin/bash
# Script para resolver conflictos repetitivos en notebooks de Jupyter
# Mantiene execution_count: null en lugar de números específicos
echo "Resolviendo conflictos en changespeakers.ipynb..."
while true; do
# Verificar si hay conflictos
if ! grep -q "<<<<<<< HEAD\|=======\|>>>>>>>" notebooks/changespeakers.ipynb; then
echo "No se encontraron marcadores de conflicto."
break
fi
echo "Resolviendo marcadores de conflicto..."
# Eliminar secciones de HEAD (mantener la versión con execution_count: null)
sed -i '/<<<<<<< HEAD/,/=======/{/<<<<<<< HEAD/d; /=======/d; }' notebooks/changespeakers.ipynb
# Eliminar marcadores de fin de conflicto
sed -i '/>>>>>>> [0-9a-f]\{7\}/d' notebooks/changespeakers.ipynb
# Limpiar cualquier marcador suelto
sed -i '/=======/d' notebooks/changespeakers.ipynb
done
echo "Conflictos resueltos."
# Verificar que el JSON sea válido
if python3 -m json.tool notebooks/changespeakers.ipynb > /dev/null 2>&1; then
echo "JSON válido ✓"
else
echo "ADVERTENCIA: El JSON podría tener problemas"
fi
# Agregar el archivo resuelto
git add notebooks/changespeakers.ipynb
echo "Archivo agregado al staging. Ejecute 'git rebase --continue' para continuar."